88 pull_request :
99 branches : [ main ]
1010
11+ permissions :
12+ contents : read
13+ packages : write
14+
1115jobs :
1216 build :
1317 name : Build for multiple platforms
@@ -155,7 +159,10 @@ jobs:
155159 name : Build and push Docker image
156160 runs-on : ubuntu-latest
157161 needs : build
158- if : github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
162+ if : startsWith(github.ref, 'refs/tags/')
163+ permissions :
164+ contents : read
165+ packages : write
159166
160167 steps :
161168 - name : Checkout code
@@ -175,14 +182,12 @@ jobs:
175182 id : meta
176183 uses : docker/metadata-action@v5
177184 with :
178- images : ghcr.io/${{ github.repository }}
185+ images : ghcr.io/zy84338719/filecodebox
179186 tags : |
180187 type=semver,pattern={{version}}
181188 type=semver,pattern={{major}}.{{minor}}
182189 type=semver,pattern={{major}}
183- type=raw,value=latest,enable={{is_default_branch}}
184- type=ref,event=branch
185- type=raw,value=dev,enable={{is_default_branch}}
190+ type=raw,value=latest
186191 labels : |
187192 org.opencontainers.image.title=FileCodeBox
188193 org.opencontainers.image.description=高性能文件分享服务 - Go语言实现
@@ -298,9 +303,9 @@ jobs:
298303
299304 **Docker 镜像:**
300305 \`\`\`bash
301- docker pull ghcr.io/${{ github.repository }} :${{ github.ref_name }}
306+ docker pull ghcr.io/zy84338719/filecodebox :${{ github.ref_name }}
302307 # 或者最新版本
303- docker pull ghcr.io/${{ github.repository }} :latest
308+ docker pull ghcr.io/zy84338719/filecodebox :latest
304309 \`\`\`
305310
306311 ### 🔧 快速开始
0 commit comments