ci(docker): publish image without leading 'v' in version tag
Strip the leading 'v' from git tags (e.g. v1.1.7 -> 1.1.7) when pushing Docker images to GHCR. https://chatgpt.com/share/e/699041b9-8610-8013-8d04-fbef93b10d3c
This commit is contained in:
3
.github/workflows/publish-image.yml
vendored
3
.github/workflows/publish-image.yml
vendored
@@ -49,7 +49,8 @@ jobs:
|
|||||||
IMAGE="ghcr.io/${{ github.repository }}"
|
IMAGE="ghcr.io/${{ github.repository }}"
|
||||||
|
|
||||||
if [ "${{ github.event_name }}" = "push" ]; then
|
if [ "${{ github.event_name }}" = "push" ]; then
|
||||||
TAG="${{ github.ref_name }}" # e.g. v1.1.0
|
RAW_TAG="${{ github.ref_name }}" # e.g. v1.1.7
|
||||||
|
TAG="${RAW_TAG#v}" # -> 1.1.7 (only strips leading 'v')
|
||||||
echo "tags=$IMAGE:$TAG,$IMAGE:latest" >> "$GITHUB_OUTPUT"
|
echo "tags=$IMAGE:$TAG,$IMAGE:latest" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo "tags=$IMAGE:stable" >> "$GITHUB_OUTPUT"
|
echo "tags=$IMAGE:stable" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
Reference in New Issue
Block a user