Skip to content

Commit 98b5f85

Browse files
committed
fix: tag build error
1 parent 7a8fc24 commit 98b5f85

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/docker.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ jobs:
4242
with:
4343
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4444
tags: |
45+
# 分支推送:生成分支名标签 (main分支推送latest)
4546
type=ref,event=branch
46-
type=ref,event=pr
47+
# Tag推送:生成版本标签 (v1.0.0)
48+
type=ref,event=tag
49+
# 语义化版本:v1.0.0格式
4750
type=semver,pattern={{version}}
48-
type=semver,pattern={{major}}.{{minor}}
51+
# 最新标签:只有main分支push时生成
4952
type=raw,value=latest,enable={{is_default_branch}}
5053
51-
- name: Build and push Docker image
54+
- name: Build Docker image
5255
uses: docker/build-push-action@v5
5356
with:
5457
context: .
@@ -57,4 +60,5 @@ jobs:
5760
tags: ${{ steps.meta.outputs.tags }}
5861
labels: ${{ steps.meta.outputs.labels }}
5962
cache-from: type=gha
60-
cache-to: type=gha,mode=max
63+
cache-to: type=gha,mode=max
64+
pull: true

0 commit comments

Comments
 (0)