fix(ci): simplify workflow to debug OAuth token timeout
Build and Push Docker Image / build-and-push (push) Failing after 2m35s

- remove QEMU setup (amd64-only build, not needed)
- remove registry build cache (buildkit cache uses separate auth flow,
  suspected cause of HTTP fallback in /v2/token request)
- switch gitea.actor/event_name to github.actor/event_name for
  broader action compatibility

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
2026-05-21 16:24:40 +09:00
parent 48374c2d09
commit eea001c911
+2 -9
View File
@@ -28,9 +28,6 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -42,7 +39,7 @@ jobs:
# 推荐做法:到 Gitea「用户设置 → 应用 → 生成 Access Token」
# 勾选 write:package 权限,将值存为仓库 Secret 名为 REGISTRY_TOKEN
# 注意:Gitea 保留 GITEA_ 前缀,secret 不能以 GITEA_ 开头
username: ${{ gitea.actor }}
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Compute image tags & labels
@@ -61,7 +58,7 @@ jobs:
# 默认分支自动打 latest
type=raw,value=latest,enable={{is_default_branch}}
# 手动触发若提供了 tag,附加这个 tag
type=raw,value=${{ inputs.tag }},enable=${{ gitea.event_name == 'workflow_dispatch' && inputs.tag != '' }}
type=raw,value=${{ inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' && inputs.tag != '' }}
- name: Build and push image
uses: docker/build-push-action@v5
@@ -71,10 +68,6 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# 使用 registry 作为构建缓存,多次构建可显著加速
# 若你的 Gitea 版本不支持 cache manifest,可注释掉这两行
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
- name: Print built tags
run: |