name: Build with Kaniko (Fixed URL) 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 (Hardcoded Host) uses: docker://gcr.io/kaniko-project/executor:v1.23.2-debug with: entrypoint: /busybox/sh args: >- -c " # 直接填入你的内部域名,避免任何 Shell 解析问题 SAFE_HOST='gitea-http.gitea.svc.cluster.local:3000' echo \"Using Host: \$SAFE_HOST\" echo \"{\\\"auths\\\":{\\\"\$SAFE_HOST\\\":{\\\"username\\\":\\\"${{ gitea.actor }}\\\",\\\"password\\\":\\\"${{ secrets.GITHUB_TOKEN }}\\\"}}}\" > /kaniko/.docker/config.json /kaniko/executor \ --context=. \ --dockerfile=Dockerfile \ --destination=\$SAFE_HOST/${{ gitea.actor }}/my-docs:latest \ --destination=\$SAFE_HOST/${{ gitea.actor }}/my-docs:${{ github.sha }} \ --insecure \ --skip-tls-verify \ --cache=true "