Skip to content

Commit

Permalink
Add build-images workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenairn committed Feb 2, 2024
1 parent 8b1407a commit ce2e4d7
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}"

0 comments on commit ce2e4d7

Please sign in to comment.