actions/checkout 无论走 github.com 还是 gitea.com 都会被国内 网络偶发 reset。runner 跟 gitea 在同一群晖,直接 git clone 本地 仓库最稳。 同时给 apt 安装列表补上 git 和 ca-certificates。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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 .
|
||||
|
||||
Reference in New Issue
Block a user