diff --git a/.github/workflows/build-images-action.yml b/.github/workflows/build-images-action.yml index e8eec546..8bcc2f75 100644 --- a/.github/workflows/build-images-action.yml +++ b/.github/workflows/build-images-action.yml @@ -6,18 +6,40 @@ permissions: on: push: branches: - - 'main' - - 'release-*' + - "main" + - "release-*" tags: - - 'v*' + - "v*" + workflow_run: + workflows: + - "Create Release" + types: + - completed jobs: + set_ref: + runs-on: ubuntu-latest + outputs: + github_ref: ${{ steps.set_ref.outputs.github_ref }} + steps: + - name: Set ref + id: set_ref + run: | + if [[ "${{ github.event_name }}" == "workflow_run" ]] && [[ -n "${{ needs.create-release.outputs.release_tag }}" ]]; then + echo "GITHUB_REF=refs/heads/${{ needs.create-release.outputs.release_tag }}" >> "${GITHUB_OUTPUT}" + else + echo "GITHUB_REF=${{ github.ref }}" >> "${GITHUB_OUTPUT}" + fi + build_ipam: + needs: set_ref name: Build IPAM container image + if: github.repository == 'metal3-io/ip-address-manager' uses: metal3-io/project-infra/.github/workflows/container-image-build.yml@main with: image-name: "ip-address-manager" pushImage: true + ref: ${{ needs.set_ref.outputs.github_ref }} secrets: QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}