Files
my-docs/.github/workflows/buidl_and_push_ghcr.yml
gitea_admin 8d546b1301
Some checks failed
Build with Kaniko (Hardcoded No Vars) / build (push) Failing after 5s
更新 .github/workflows/buidl_and_push_ghcr.yml
2025-12-18 15:21:34 +00:00

41 lines
1.3 KiB
YAML

name: Build with Kaniko (Hardcoded No Vars)
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
packages: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build and Push
uses: docker://gcr.io/kaniko-project/executor:v1.23.2-debug
with:
entrypoint: /busybox/sh
# 注意:下面所有出现域名的地方都直接写死了,确保不会出错
args: >-
-c
"
echo '正在生成认证信息...' &&
echo '{\"auths\":{\"gitea-http.gitea.svc.cluster.local:3000\":{\"username\":\"${{ gitea.actor }}\",\"password\":\"${{ secrets.GITHUB_TOKEN }}\"}}}' > /kaniko/.docker/config.json &&
echo '认证文件已生成,开始构建...' &&
/kaniko/executor \
--context=. \
--dockerfile=Dockerfile \
--destination=gitea-http.gitea.svc.cluster.local:3000/${{ gitea.actor }}/my-docs:latest \
--destination=gitea-http.gitea.svc.cluster.local:3000/${{ gitea.actor }}/my-docs:${{ github.sha }} \
--insecure \
--skip-tls-verify \
--cache=true
"