From 12d091d366453bb09538715abc333700b0bfe188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Sat, 23 May 2026 17:38:36 +0800 Subject: [PATCH] dockerfile --- .gitea/workflows/deploy.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 2c4a52a..2ede49d 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -10,9 +10,21 @@ jobs: K3S_HOST: ${{ secrets.K3S_HOST }} APP_NAME: ${{ gitea.repo_name }} steps: - - name: 拉取代码 - uses: actions/checkout@v4 - + - name: 拉取代码(Gitea官方源) + uses: gitea/actions/checkout@v4 + with: + fetch-depth: 0 # 可选:拉取完整历史,加速后续操作 + timeout-minutes: 10 # 增加超时,避免拉取中断 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ env.REGISTRY }}/${{ env.APP_NAME }}:${{ gitea.sha }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.APP_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.APP_NAME }}:buildcache,mode=max - name: SSH部署K3s run: | mkdir -p ~/.ssh