Skip to content

Commit

Permalink
Merge pull request #250 from Kuadrant/ci_fix_image_build_job
Browse files Browse the repository at this point in the history
ci: Fix image build jobs to use ref instead of sha on tags
  • Loading branch information
mikenairn authored Sep 26, 2024
2 parents 2e24974 + f912466 commit dab8598
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

env:
IMG_TAGS: ${{ github.sha }} ${{ github.ref_name }}
IMG_REF: ${{ github.sha }}
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
IMG_REGISTRY_REPO: dns-operator
Expand All @@ -22,7 +23,7 @@ jobs:
name: Build and Push image
runs-on: ubuntu-20.04
outputs:
build-image: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ steps.build-image.outputs.image }}:${{ github.sha }}
build-image: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ steps.build-image.outputs.image }}:${{ env.IMG_REF }}
build-tags: ${{ steps.build-image.outputs.tags }}
steps:
- name: Check out code
Expand All @@ -34,6 +35,11 @@ jobs:
run: |
echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV
- name: Update image ref on tags
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "IMG_REF=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Install qemu dependency
run: |
sudo apt-get update
Expand Down Expand Up @@ -75,7 +81,7 @@ jobs:
needs: [build]
runs-on: ubuntu-20.04
outputs:
bundle-image: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ steps.build-image.outputs.image }}:${{ github.sha }}
bundle-image: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ steps.build-image.outputs.image }}:${{ env.IMG_REF }}

steps:
- name: Check out code
Expand Down Expand Up @@ -103,7 +109,7 @@ jobs:
./bundle.Dockerfile
- name: Print Build Info
run: echo "Image = ${{ steps.build-image.outputs.image }}, Tags = ${{ steps.build-image.outputs.tags }}"
run: echo "Image = ${{ steps.build-image.outputs.image }}, Tags = ${{ steps.build-image.outputs.tags }}, Operator IMG = ${{ needs.build.outputs.build-image }}"

- name: Push Image
if: github.repository_owner == 'kuadrant'
Expand Down Expand Up @@ -147,7 +153,7 @@ jobs:
./tmp/catalog/index.Dockerfile
- name: Print Build Info
run: echo "Image = ${{ steps.build-image.outputs.image }}, Tags = ${{ steps.build-image.outputs.tags }}"
run: echo "Image = ${{ steps.build-image.outputs.image }}, Tags = ${{ steps.build-image.outputs.tags }}, Bundle IMG = ${{ needs.build-bundle.outputs.bundle-image }}"

- name: Push Image
if: github.repository_owner == 'kuadrant'
Expand Down

0 comments on commit dab8598

Please sign in to comment.