Skip to content

Commit 9423868

Browse files
committed
Set image tag for exporters to latest if being merged, commit hash otherwise
Signed-off-by: Eric Sauer <esauer@redhat.com>
1 parent a2d2411 commit 9423868

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/test-images.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ jobs:
5050
create-images:
5151
runs-on: ubuntu-latest
5252
needs: setup
53+
env:
54+
BRANCH_REF: ${{ steps.variables.outputs.branch_ref }}
55+
PR_TYPE: ${{ steps.variables.outputs.pr_type }}
56+
PR_NUMBER: ${{ steps.variables.outputs.pr_number }}
57+
COMMIT_HASH: ${{ steps.variables.outputs.commit_hash }}
58+
IMAGE_TAG: ${{ case(github.ref == 'refs/heads/main', 'latest', 'v' + steps.variables.outputs.commit_hash) }}
59+
5360
steps:
5461
- name: Validate outputs from setup jobs
55-
env:
56-
BRANCH_REF: ${{ steps.variables.outputs.branch_ref }}
57-
PR_TYPE: ${{ steps.variables.outputs.pr_type }}
58-
PR_NUMBER: ${{ steps.variables.outputs.pr_number }}
59-
COMMIT_HASH: ${{ steps.variables.outputs.commit_hash }}
6062
run: echo "$BRANCH_REF, $PR_TYPE, $PR_NUMBER, $COMMIT_HASH"
6163
- name: Checkout code
6264
uses: actions/checkout@v4
@@ -67,7 +69,7 @@ jobs:
6769
uses: "./.github/workflow_templates/build_push_exporters"
6870
with:
6971
image: rc-pelorus-exporter
70-
tags: ${{ needs.setup.outputs.commit_hash }}
72+
tags: v${{ needs.setup.outputs.commit_hash }}
7173
quay_imagenamespace: ${{ secrets.QUAY_IMAGE_NAMESPACE }}
7274
quay_username: ${{ secrets.QUAY_USERNAME }}
7375
quay_password: ${{ secrets.QUAY_PASSWORD }}

0 commit comments

Comments
 (0)