mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-12 16:10:03 +01:00
Strip leading 'v' for docker image tags (#224)
This commit is contained in:
parent
511336d346
commit
26d5f9f306
1 changed files with 8 additions and 10 deletions
18
.github/workflows/publish-docker.sh
vendored
18
.github/workflows/publish-docker.sh
vendored
|
|
@ -26,19 +26,17 @@ function publish {
|
|||
docker_push "$SRC_IMAGE" "$GHCR_IMAGE:$tag"
|
||||
}
|
||||
|
||||
# Publish current branch/tag (e.g. `main` or `v1.2.3`)
|
||||
ver=${GITHUB_REF##*/}
|
||||
publish "$ver"
|
||||
|
||||
# Publish major/minor/latest for version tags
|
||||
if [[ "$GITHUB_REF" = refs/tags/v* ]]; then
|
||||
major_ver=${ver%%.*} # e.g. `v1`
|
||||
publish "$major_ver"
|
||||
|
||||
minor_ver=${ver%.*} # e.g. `v1.2`
|
||||
publish "$minor_ver"
|
||||
# Publish major/minor/patch/latest version tags
|
||||
ver=${GITHUB_REF#refs/tags/v}
|
||||
|
||||
publish "$ver" # e.g. `1.2.3`
|
||||
publish "${ver%.*}" # e.g. `1.2`
|
||||
publish "${ver%%.*}" # e.g. `1`
|
||||
publish "latest"
|
||||
else
|
||||
# Publish branch
|
||||
publish "${GITHUB_REF##*/}"
|
||||
fi
|
||||
|
||||
# Clear credentials
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue