From 7917975b5ddab53874b126779f290441ad012005 Mon Sep 17 00:00:00 2001 From: alboped Date: Fri, 10 Apr 2026 23:04:20 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BC=98=E5=8C=96=E6=AD=A4=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e0c264e..472832e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -56,9 +56,22 @@ jobs: - name: Build run: yarn build + # 直连 deb.debian.org 在国内 Runner 上常极慢或卡住;换镜像并限制超时 - name: Install rsync and OpenSSH client if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') - run: apt-get update && apt-get install -y --no-install-recommends rsync openssh-client + run: | + set -e + export DEBIAN_FRONTEND=noninteractive + shopt -s nullglob + for f in /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources /etc/apt/sources.list.d/*.sources /etc/apt/sources.list.d/*.list; do + [ -f "$f" ] || continue + sed -i \ + -e 's/deb.debian.org/mirrors.aliyun.com/g' \ + -e 's/security.debian.org/mirrors.aliyun.com/g' \ + "$f" + done + apt-get -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o Acquire::Retries=2 update + apt-get install -y --no-install-recommends rsync openssh-client - name: Deploy to Nginx (rsync) if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') @@ -77,4 +90,4 @@ jobs: rsync -avz --delete \ -e "ssh -i ~/.ssh/id_deploy -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes" \ dist/ \ - "${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/chat-one-web" + "${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/chat.alboped.com/"