feat: 支持token级打码代理并完善有头Docker双镜像发布

This commit is contained in:
genz27
2026-03-03 20:03:25 +08:00
parent cc6036ad37
commit 6d4cb8bf9a
15 changed files with 373 additions and 70 deletions

View File

@@ -18,6 +18,18 @@ env:
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- variant: standard
dockerfile: Dockerfile
image_suffix: ""
cache_scope: standard
- variant: headed
dockerfile: Dockerfile.headed
image_suffix: -headed
cache_scope: headed
permissions:
contents: read
packages: write
@@ -44,7 +56,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.image_suffix }}
tags: |
type=ref,event=branch
type=ref,event=pr
@@ -52,13 +64,14 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
- name: Build and push Docker image (${{ matrix.variant }})
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=${{ matrix.cache_scope }}
cache-to: type=gha,mode=max,scope=${{ matrix.cache_scope }}