From 93ef7d54f52199b4183928bfeb2013a790082834 Mon Sep 17 00:00:00 2001 From: yuming Date: Tue, 12 May 2026 09:01:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E6=8B=89=E5=8F=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=94=B9=E8=B5=B0=E5=B1=80=E5=9F=9F=E7=BD=91=20gitea=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E4=BE=9D=E8=B5=96=E5=A4=96=E7=BD=91=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit actions/checkout 无论走 github.com 还是 gitea.com 都会被国内 网络偶发 reset。runner 跟 gitea 在同一群晖,直接 git clone 本地 仓库最稳。 同时给 apt 安装列表补上 git 和 ca-certificates。 Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/deploy.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4c49264..6ea41c0 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -57,7 +57,8 @@ jobs: sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null || true sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null || true apt-get update -qq - apt-get install -y -qq docker.io + # 顺手装 git:拉取代码那步要用,ubuntu-latest 默认不带 + apt-get install -y -qq docker.io git ca-certificates # 装完之后让 daemon 重新读上面三处配置;不同启动方式都试一遍 systemctl daemon-reload 2>/dev/null || true systemctl restart docker 2>/dev/null || service docker restart 2>/dev/null || true @@ -65,8 +66,13 @@ jobs: sleep 3 - name: 拉取代码 - # 走 gitea.com 镜像,避免裸连 github.com 偶发 unexpected EOF - uses: https://gitea.com/actions/checkout@v4 + # 直接走局域网 gitea,不再依赖任何外网 action mirror + run: | + git init + git remote add origin http://git.ymxixi.space/adminym/telegram-downloader.git + # 优先按本次触发的 commit SHA 拉,确保部署的是 push 上来的那次 + git fetch --depth 1 origin "$GITHUB_SHA" + git checkout FETCH_HEAD - name: 构建镜像 run: docker build -t telegram-downloader:latest .