Skip to content

Commit f06d91f

Browse files
committed
fix(workflows): generate proper version tags in docker-push workflow
- Extract version from tag input manually instead of relying on semver detection - Generate 0.1.0, 0.1, and latest tags correctly - Fixes issue where only latest tag was created
1 parent dfa7c8a commit f06d91f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/docker-push.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,26 @@ jobs:
4444
registry: ${{ env.REGISTRY }}
4545
username: ${{ github.actor }}
4646
password: ${{ secrets.GITHUB_TOKEN }}
47+
- name: Extract version from tag
48+
id: version
49+
run: |
50+
# Remove 'v' prefix if present (v0.1.0 -> 0.1.0)
51+
VERSION="${INPUT_TAG#v}"
52+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
53+
# Extract major.minor (0.1.0 -> 0.1)
54+
MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
55+
echo "major_minor=$MAJOR_MINOR" >> "$GITHUB_OUTPUT"
56+
echo "Extracted version: $VERSION (major.minor: $MAJOR_MINOR)"
57+
env:
58+
INPUT_TAG: ${{ inputs.tag }}
4759
- name: Extract metadata
4860
id: meta
4961
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
5062
with:
5163
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5264
tags: |
53-
type=semver,pattern={{version}}
54-
type=semver,pattern={{major}}.{{minor}}
65+
type=raw,value=${{ steps.version.outputs.version }}
66+
type=raw,value=${{ steps.version.outputs.major_minor }}
5567
type=raw,value=latest
5668
labels: |
5769
org.opencontainers.image.title=${{ env.DOCKER_IMAGE_TITLE }}

0 commit comments

Comments
 (0)