ci: 部署脚本出错即失败,git pull 显式指定 origin main
Deploy / deploy (build, debian, 22) (push) Canceled after 0s

服务器上的 main 没有设置上游分支,git pull --ff-only 报错后脚本照常往下执行,
用旧代码重新构建,CI 却显示成功,导致 e6a3da1 等提交一直没上线。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-26 18:49:25 +08:00
1 parent ceba1c68f2
commit 4616bd9469
1 file changed
+2 -1
+2 -1
View File
@@ -58,6 +58,7 @@ jobs:
username: root
key: ${{ secrets.KEY }}
script: |
set -e
cd /root/WebPreview
git pull --ff-only
git pull --ff-only origin main
docker compose up -d --build