更新 .github/workflows/buidl_and_push_ghcr.yml
Some checks failed
Build with Kaniko (PAT Auth) / build (push) Failing after 6s

This commit is contained in:
2025-12-18 15:34:36 +00:00
parent 3104ee17d3
commit bf0a39dcb4

View File

@@ -1,14 +1,10 @@
name: Build with Kaniko (Hardcoded No Vars)
name: Build with Kaniko (PAT Auth)
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
packages: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
@@ -20,13 +16,14 @@ jobs:
uses: docker://gcr.io/kaniko-project/executor:v1.23.2-debug
with:
entrypoint: /busybox/sh
# 注意:下面所有出现域名的地方都直接写死了,确保不会出错
args: >-
-c
"
echo '正在生成认证信息...' &&
echo '正在生成认证信息 (使用 PAT)...' &&
echo '{\"auths\":{\"gitea.173114.xyz\":{\"username\":\"${{ gitea.actor }}\",\"password\":\"${{ secrets.PACKAGES_TOKEN }}\"}}}' > /kaniko/.docker/config.json &&
# === 重点修改在这里 ===
# 将 secrets.GITHUB_TOKEN 换成了 secrets.PACKAGES_TOKEN
echo '{\"auths\":{\"gitea-http.gitea.svc.cluster.local:3000\":{\"username\":\"${{ gitea.actor }}\",\"password\":\"${{ secrets.PACKAGES_TOKEN }}\"}}}' > /kaniko/.docker/config.json &&
echo '认证文件已生成,开始构建...' &&