mirror of
https://github.com/Gradiant/5g-images.git
synced 2025-11-02 04:53:13 +00:00
Adde redhat ubi build and push to github actions
This commit is contained in:
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
@@ -74,15 +74,6 @@ jobs:
|
||||
else
|
||||
echo "build_ubi=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Get Image Info for ubi
|
||||
if: steps.ubi_dockerfile.outputs.build_ubi == 'true'
|
||||
id: ubi-image-info
|
||||
run: |
|
||||
source ./images/${{ matrix.image }}/ubi_image_info.sh
|
||||
echo "::set-output name=platforms::$PLATFORMS"
|
||||
echo "::set-output name=image_tag::$IMAGE_TAG-ubi"
|
||||
echo "::set-output name=image::${{ matrix.image }}"
|
||||
|
||||
- name: Login to RedHat Registry
|
||||
if: steps.ubi_dockerfile.outputs.build_ubi == 'true'
|
||||
@@ -95,11 +86,11 @@ jobs:
|
||||
if: steps.ubi_dockerfile.outputs.build_ubi == 'true'
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./images/${{ steps.ubi-image-info.outputs.image }}/
|
||||
context: ./images/${{ steps.image-info.outputs.image }}/
|
||||
file: { context }/Dockerfile.ubi
|
||||
push: false
|
||||
tags: openverso/${{ steps.ubi-image-info.outputs.image }}:${{ steps.ubi-image-info.outputs.image_tag }}
|
||||
build-args: version=${{ steps.ubi-image-info.outputs.image_tag }}
|
||||
platforms: ${{ steps.ubi-image-info.outputs.platforms }}
|
||||
tags: openverso/${{ steps.image-info.outputs.image }}:${{ steps.image-info.outputs.image_tag }}-ubi
|
||||
build-args: version=${{ steps.image-info.outputs.image_tag }}
|
||||
platforms: ${{ steps.image-info.outputs.platforms }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
29
.github/workflows/push.yml
vendored
29
.github/workflows/push.yml
vendored
@@ -72,3 +72,32 @@ jobs:
|
||||
platforms: ${{ steps.image-info.outputs.platforms }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Check for ubi Dockerfile
|
||||
id: ubi_dockerfile
|
||||
run: |
|
||||
if test -f "images/${{ matrix.image }}/Dockerfile.ubi"; then
|
||||
echo "build_ubi=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "build_ubi=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Login to RedHat Registry
|
||||
if: steps.ubi_dockerfile.outputs.build_ubi == 'true'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.REDHAT_USERNAME }}
|
||||
password: ${{ secrets.REDHAT_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
if: steps.ubi_dockerfile.outputs.build_ubi == 'true'
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./images/${{ steps.image-info.outputs.image }}/
|
||||
file: { context }/Dockerfile.ubi
|
||||
push: true
|
||||
tags: openverso/${{ steps.image-info.outputs.image }}:${{ steps.image-info.outputs.image_tag }}-ubi
|
||||
build-args: version=${{ steps.image-info.outputs.image_tag }}
|
||||
platforms: ${{ steps.image-info.outputs.platforms }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
Reference in New Issue
Block a user