feat: add release-aware image versioning

This commit is contained in:
DiheChen committed 2026-10-31 01:22:14 +08:00
1 parent f4038fc3dd
commit f0238ad734
1 file changed
+3 -2
+3 -2
View File
@@ -84,7 +84,8 @@ jobs:
images: ghcr.io/${{ github.repository }}/${{ matrix.image }}
flavor: latest=false
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=edge,enable={{is_default_branch}}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{version}}
type=sha,prefix=
- uses: docker/build-push-action@v7
@@ -94,7 +95,7 @@ jobs:
target: ${{ matrix.target }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: VERSION=${{ github.sha }}
build-args: VERSION=${{ github.ref_type == 'tag' && format('{0}+{1}', github.ref_name, github.sha) || github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.image }}