ci: 部署脚本出错即失败,git pull 显式指定 origin main
Deploy / deploy (build, debian, 22) (push) Canceled after 0s
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:
1 parent
ceba1c68f2
commit
4616bd9469
1 file changed
+2
-1
@@ -58,6 +58,7 @@ jobs:
|
|||||||
username: root
|
username: root
|
||||||
key: ${{ secrets.KEY }}
|
key: ${{ secrets.KEY }}
|
||||||
script: |
|
script: |
|
||||||
|
set -e
|
||||||
cd /root/WebPreview
|
cd /root/WebPreview
|
||||||
git pull --ff-only
|
git pull --ff-only origin main
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
Reference in new issue
Block a user