diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index b9bc7e3..9f6e811 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -10,14 +10,18 @@ jobs: steps: - name: 安装 Docker CLI run: | - # 大概率 gitea act_runner 已预装 docker,先探测(避免 apt 走国外源 3h 超时) + # 大概率 gitea act_runner 已预装 docker,先探测(避免 apt 走国外源超时) if command -v docker >/dev/null 2>&1; then echo "Docker 已预装:$(docker --version)" exit 0 fi - echo "Docker 未预装,开始 apt 安装(每步限时 3 分钟,超时快速失败)" - timeout 60 apt-get update -qq || { echo "apt-get update 超时/失败"; exit 1; } - timeout 180 apt-get install -y -qq docker.io || { echo "docker.io 安装超时/失败"; exit 1; } + echo "Docker 未预装,换 Ubuntu 源到阿里云再 apt 安装" + # 兼容 legacy sources.list、deb822 .sources、以及 sources.list.d/*.list + sed -i 's|archive.ubuntu.com|mirrors.aliyun.com|g;s|security.ubuntu.com|mirrors.aliyun.com|g' /etc/apt/sources.list 2>/dev/null || true + sed -i 's|archive.ubuntu.com|mirrors.aliyun.com|g;s|security.ubuntu.com|mirrors.aliyun.com|g' /etc/apt/sources.list.d/*.sources 2>/dev/null || true + sed -i 's|archive.ubuntu.com|mirrors.aliyun.com|g;s|security.ubuntu.com|mirrors.aliyun.com|g' /etc/apt/sources.list.d/*.list 2>/dev/null || true + timeout 90 apt-get update -qq || { echo "apt-get update 超时/失败"; exit 1; } + timeout 240 apt-get install -y -qq docker.io || { echo "docker.io 安装超时/失败"; exit 1; } docker --version - name: 拉取代码