Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker image name for release branch #2407

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/actions/determine-docker-image-tag/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,18 @@ runs:
primary_tag="pr-${pr_num}"
default_tag="nightly"

# For pull request to the release branch, use the release branch latest tag as the default tag (vx.x).
# For pull request to the release branch, use the release branch latest tag as the default tag (release/vx.x).
# This is only set if the event that triggers the workflow execution is pull_request or pull_request_target.
if [[ "$GITHUB_BASE_REF" =~ ^release/v([0-9]+)\.([0-9]+)$ ]]; then
tag_name=`echo $GITHUB_BASE_REF | sed -e 's:^release/::'`
default_tag="${tag_name}"
default_tag="$(echo "$GITHUB_BASE_REF")"
fi
elif [ "$GITHUB_REF" = "refs/heads/main" ]; then
echo "nightly" > versions/VALD_VERSION

primary_tag="nightly"
default_tag="nightly"
elif [[ "$GITHUB_REF" =~ ^refs/heads/release/v([0-9]+)\.([0-9]+)$ ]]; then
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/heads/release/::'`
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/heads/::'`
echo "${tag_name}" > versions/VALD_VERSION

primary_tag="${tag_name}"
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ runs:
if [[ "$GITHUB_REF" =~ ^refs/tags/.* ]]; then
latest_tags="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
extra_tags="${extra_tags} ${latest_tags}"

major_minor_tag=$(echo "$GITHUB_REF" | sed -E 's/^refs\/tags\/v?([0-9]+\.[0-9]+).*$/v\1/')
major_minor_tags="-t ${IMAGE_NAME}:${major_minor_tag} -t ${ALTER_IMAGE_NAME}:${major_minor_tag}"
extra_tags="${extra_tags} ${major_minor_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}
Expand Down
Loading