chore(deploy): CI 双轨——发版同时部署 EC2 + 阿里(EC2→Ali 迁移期)

deploy-{server,site,client}.sh 目标主机参数化(DEPLOY_HOST/USER/SSH_KEY),
不传时行为与现状完全一致(只发 EC2)。workflow 的 Deploy 拆成 EC2(前)+
Ali(后,if:always + continue-on-error,影子目标失败不挡线上)。deploy-server
的 ali 分支只换二进制 + reload 独立 nginx(listen 443),不启动 jiu(阿里 DB
为只读从库,切流提升为主后才起)。新增 deploy/nginx-jiu-ali.conf 并打进
configs.tar.gz。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YZ4DskSRKsSiheQonFtQvx
This commit is contained in:
wangjia
2026-06-23 22:56:59 +08:00
parent 9139192097
commit 2eb4275e6f
9 changed files with 238 additions and 34 deletions
+14 -1
View File
@@ -180,7 +180,7 @@ jobs:
GITEA_REPOSITORY: ${{ gitea.repository }}
run: sh scripts/ci/release-client.sh "${{ gitea.ref_name }}"
- name: Deploy
- name: Deploy → EC2
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
FORGEJO_URL: ${{ secrets.FORGEJO_URL }}
@@ -190,6 +190,19 @@ jobs:
EC2_USER: ${{ secrets.EC2_USER }}
run: sh scripts/ci/deploy-client.sh "${{ gitea.ref_name }}"
# 迁移期影子目标:同步 Flutter web + version.yaml + 安装包到阿里机。失败不挡 EC2。
- name: Deploy → Ali (migration shadow)
if: always()
continue-on-error: true
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
FORGEJO_URL: ${{ secrets.FORGEJO_URL }}
GITEA_REPOSITORY: ${{ gitea.repository }}
DEPLOY_SSH_KEY: ${{ secrets.ALI_SSH_KEY }}
DEPLOY_HOST: ${{ secrets.ALI_HOST }}
DEPLOY_USER: ${{ secrets.ALI_USER }}
run: sh scripts/ci/deploy-client.sh "${{ gitea.ref_name }}"
- name: Notify
if: always()
env: