Skip to content

Commit 6a84044

Browse files
Merge pull request #816 from Nordix/mquhuy/backport-container-build-image-wf-1.7
🌱 Backport container build image wf to release-1.7
2 parents 1c28946 + ef23b33 commit 6a84044

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/build-images-action.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,40 @@ permissions:
66
on:
77
push:
88
branches:
9-
- 'main'
10-
- 'release-*'
9+
- "main"
10+
- "release-*"
1111
tags:
12-
- 'v*'
12+
- "v*"
13+
workflow_run:
14+
workflows:
15+
- "Create Release"
16+
types:
17+
- completed
1318

1419
jobs:
20+
set_ref:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
github_ref: ${{ steps.set_ref.outputs.github_ref }}
24+
steps:
25+
- name: Set ref
26+
id: set_ref
27+
run: |
28+
if [[ "${{ github.event_name }}" == "workflow_run" ]] && [[ -n "${{ needs.create-release.outputs.release_tag }}" ]]; then
29+
echo "GITHUB_REF=refs/heads/${{ needs.create-release.outputs.release_tag }}" >> "${GITHUB_OUTPUT}"
30+
else
31+
echo "GITHUB_REF=${{ github.ref }}" >> "${GITHUB_OUTPUT}"
32+
fi
33+
1534
build_ipam:
35+
needs: set_ref
1636
name: Build IPAM container image
37+
if: github.repository == 'metal3-io/ip-address-manager'
1738
uses: metal3-io/project-infra/.github/workflows/container-image-build.yml@main
1839
with:
1940
image-name: "ip-address-manager"
2041
pushImage: true
42+
ref: ${{ needs.set_ref.outputs.github_ref }}
2143
secrets:
2244
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
2345
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

0 commit comments

Comments
 (0)