Skip to content

Commit

Permalink
add commit hash build image (#2359) (#2371)
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <[email protected]>
Co-authored-by: Yusuke Kato <[email protected]>
  • Loading branch information
vdaas-ci and kpango authored Feb 16, 2024
1 parent c657783 commit 1326e72
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ runs:
latest_tags="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
extra_tags="${extra_tags} ${latest_tags}"
fi
if [[ "$GITHUB_REF" =~ ^refs/heads/main$ ]] || [[ "$GITHUB_REF" =~ ^refs/heads/master$ ]] || [[ "$GITHUB_REF" =~ ^refs/heads/release.* ]] || [[ "${PRIMARY_TAG}" == "nightly" ]]; then
commit_hash=${GITHUB_SHA::8}
hash_tags="-t ${IMAGE_NAME}:${commit_hash} -t ${ALTER_IMAGE_NAME}:${commit_hash}"
extra_tags="${extra_tags} ${hash_tags}"
fi
echo "EXTRA_TAGS is determined: ${extra_tags}"
echo "EXTRA_TAGS=${extra_tags}" >> $GITHUB_OUTPUT
env:
Expand Down

0 comments on commit 1326e72

Please sign in to comment.