From 00fd9c81bb28f7644c3c4c5e561628d8bb3670eb Mon Sep 17 00:00:00 2001 From: Lee <1633292@qq.com> Date: Mon, 8 Jun 2026 15:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index a7a46c1..40f045c 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -16,8 +16,14 @@ jobs: runs-on: centos-env steps: - - name: 1. 拉取最新的仓库代码 - uses: actions/checkout@v4 + # 替换为以下纯命令形式(docker:cli 镜像中默认自带 git): + - name: 1. 拉取最新的仓库代码 (纯 Git 命令行模式) + run: | + # 清空当前工作目录,防止历史残留 + rm -rf ./* + # 利用 Gitea 自动注入的内置变量,动态克隆当前仓库、当前分支、当前提交 + git clone --depth 1 -b ${{ gitea.ref_name }} http://gitea-server:3000/${{ gitea.repository }} . + git checkout ${{ gitea.sha }} - name: 2. 触发 Docker 容器内编译与镜像打包 run: |