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/"