From ce2e4d7f7e396b896178eb673848aff3e4e6fe54 Mon Sep 17 00:00:00 2001 From: Michael Nairn Date: Fri, 2 Feb 2024 18:27:59 +0000 Subject: [PATCH] Add build-images workflow --- .github/workflows/build-images.yaml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index ebc5b9a5..651b6ba1 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -28,7 +28,7 @@ jobs: name: Build and Push image runs-on: ubuntu-20.04 outputs: - build-image: ${{ steps.build-image.outputs.image }} + build-image: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ steps.build-image.outputs.image }}:${{ github.sha }} build-tags: ${{ steps.build-image.outputs.tags }} steps: - name: Check out code @@ -71,14 +71,14 @@ jobs: needs: [build] runs-on: ubuntu-20.04 outputs: - bundle-image: ${{ steps.build-image.outputs.image }} + bundle-image: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ steps.build-image.outputs.image }}:${{ github.sha }} steps: - name: Check out code uses: actions/checkout@v4 - name: Run make bundle - run: make bundle IMG=${{ needs.build.outputs.build-image }}:${{ github.sha }} + run: make bundle IMG=${{ needs.build.outputs.build-image }} - name: Build Image id: build-image @@ -110,10 +110,28 @@ jobs: name: Build and Push catalog image needs: [build-bundle] runs-on: ubuntu-20.04 + outputs: + catalog-image: ${{ steps.catalog-image.outputs.image }} steps: - name: Check out code uses: actions/checkout@v4 + - id: catalog-image + run: echo "image=${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ env.OPERATOR_NAME }}-catalog:${{ github.sha }}" >> "$GITHUB_OUTPUT" + - name: Run make catalog-build - run: make bundle BUNDLE_IMG=${{ needs.build-bundle.outputs.bundle-image }}:${{ github.sha }} + run: make catalog-build BUNDLE_IMG=${{ needs.build-bundle.outputs.bundle-image }} CATALOG_IMG=${{ steps.catalog-image.outputs.image }} + - name: Push Image + if: github.repository_owner == 'kuadrant' + id: push-to-quay + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build-image.outputs.image }} + tags: ${{ steps.build-image.outputs.tags }} + registry: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }} + username: ${{ secrets.IMG_REGISTRY_USERNAME }} + password: ${{ secrets.IMG_REGISTRY_TOKEN }} + + - name: Print Image URL + run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"