diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml index 641f72c..e5cfe7f 100644 --- a/.gitea/workflows/docker.yml +++ b/.gitea/workflows/docker.yml @@ -18,15 +18,24 @@ jobs: build-and-push: runs-on: ubuntu-latest container: - image: gcr.io/kaniko-project/executor:debug - options: --entrypoint "" + image: alpine:3.19 steps: + - name: Install dependencies + run: | + apk add --no-cache curl git bash + - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Download Kaniko + run: | + mkdir -p /kaniko + curl -L https://github.com/GoogleContainerTools/kaniko/releases/download/v1.23.2/executor-linux-amd64 -o /kaniko/executor + chmod +x /kaniko/executor + - name: Create registry config run: | mkdir -p /kaniko/.docker @@ -40,11 +49,10 @@ jobs: } } EOF - echo "Registry config created" + echo "Registry config created for ${{ env.REGISTRY }}" - name: Build and push image run: | - # 获取短 SHA SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) REF_NAME="${{ github.ref_name }}" REF="${{ github.ref }}" @@ -65,14 +73,11 @@ jobs: --context "${GITHUB_WORKSPACE}" \ --dockerfile "${GITHUB_WORKSPACE}/Dockerfile" \ $DESTINATIONS \ - --cache=true \ - --cache-repo=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/cache \ - --snapshot-mode=redo \ - --use-new-run + --cache=false \ + --snapshot-mode=redo - name: Build complete run: | echo "✅ 镜像构建完成!" echo "仓库: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" echo "分支: ${{ github.ref_name }}" - echo "提交: ${{ github.sha }}"