Files
my-docs/.github/workflows/buidl_and_push_ghcr.yml
gitea_admin 130877efe6
All checks were successful
Build with Kaniko (Clean & Fixed) / build (push) Successful in 1m3s
更新 .github/workflows/buidl_and_push_ghcr.yml
2025-12-18 15:40:20 +00:00

34 lines
1.1 KiB
YAML

name: Build with Kaniko (Clean & Fixed)
on:
push:
branches: [ main ]
workflow_dispatch:
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
"
HOST='gitea-http.gitea.svc.cluster.local:3000';
RAW_USER='${{ gitea.actor }}';
LOWER_USER=$(echo $RAW_USER | tr '[:upper:]' '[:lower:]');
PASS='${{ secrets.PACKAGES_TOKEN }}';
echo \"DEBUG: Host=\$HOST User=\$LOWER_USER\";
AUTH_STR=$(echo -n \"${RAW_USER}:${PASS}\" | base64 | tr -d '\n');
echo \"{\\\"auths\\\":{\\\"\$HOST\\\":{\\\"auth\\\":\\\"\$AUTH_STR\\\"}}}\" > /kaniko/.docker/config.json;
/kaniko/executor --context=. --dockerfile=Dockerfile --destination=\$HOST/\$LOWER_USER/my-docs:latest --destination=\$HOST/\$LOWER_USER/my-docs:${{ github.sha }} --insecure --skip-tls-verify --cache=true
"