@@ -56,9 +56,22 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: yarn build
|
run: yarn build
|
||||||
|
|
||||||
|
# 直连 deb.debian.org 在国内 Runner 上常极慢或卡住;换镜像并限制超时
|
||||||
- name: Install rsync and OpenSSH client
|
- name: Install rsync and OpenSSH client
|
||||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
|
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)
|
- name: Deploy to Nginx (rsync)
|
||||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
|
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
|
||||||
@@ -77,4 +90,4 @@ jobs:
|
|||||||
rsync -avz --delete \
|
rsync -avz --delete \
|
||||||
-e "ssh -i ~/.ssh/id_deploy -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes" \
|
-e "ssh -i ~/.ssh/id_deploy -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes" \
|
||||||
dist/ \
|
dist/ \
|
||||||
"${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/chat-one-web"
|
"${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/chat.alboped.com/"
|
||||||
|
|||||||
Reference in New Issue
Block a user