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 e1c16e9 commit 8b1407a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 }}

0 comments on commit 8b1407a

Please sign in to comment.