Adde redhat ubi build and push to github actions

This commit is contained in:
Carlos Giraldo
2023-06-01 07:48:41 +02:00
parent 7d117bd0b9
commit 6c420748fd
2 changed files with 33 additions and 13 deletions

View File

@@ -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

View File

@@ -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