ci: 优化此配置;
Some checks failed
CI / build (push) Failing after 2m23s

This commit is contained in:
2026-04-10 23:04:20 +08:00
parent 001af10c2a
commit 7917975b5d

View File

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