From 8b1407a1b08a4049f3b6e1d84916c38ea0466f21 Mon Sep 17 00:00:00 2001 From: Michael Nairn Date: Fri, 2 Feb 2024 18:02:29 +0000 Subject: [PATCH] Add build-images workflow --- .github/workflows/build-images.yaml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 8fd46aca..ebc5b9a5 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -27,6 +27,9 @@ jobs: build: name: Build and Push image runs-on: ubuntu-20.04 + outputs: + build-image: ${{ steps.build-image.outputs.image }} + build-tags: ${{ steps.build-image.outputs.tags }} steps: - name: Check out code uses: actions/checkout@v4 @@ -65,23 +68,24 @@ jobs: build-bundle: name: Build and Push bundle image + needs: [build] runs-on: ubuntu-20.04 + outputs: + bundle-image: ${{ steps.build-image.outputs.image }} + steps: - name: Check out code uses: actions/checkout@v4 - - name: Add latest tag - if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} - id: add-latest-tag - run: | - echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV + - name: Run make bundle + run: make bundle IMG=${{ needs.build.outputs.build-image }}:${{ github.sha }} - name: Build Image id: build-image uses: redhat-actions/buildah-build@v2 with: image: ${{ env.OPERATOR_NAME }}-bundle - tags: ${{ env.IMG_TAGS }} + tags: ${{ needs.build.outputs.build-tags }} dockerfiles: | ./bundle.Dockerfile @@ -104,14 +108,12 @@ jobs: build-catalog: name: Build and Push catalog image - needs: [build, build-bundle] + needs: [build-bundle] runs-on: ubuntu-20.04 steps: - name: Check out code uses: actions/checkout@v4 - - name: Add latest tag - if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }} - id: add-latest-tag - run: | - echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV + - name: Run make catalog-build + run: make bundle BUNDLE_IMG=${{ needs.build-bundle.outputs.bundle-image }}:${{ github.sha }} +