ci(部署): 推 origin 时 Gitea 也会拿这份工作流再部署一遍,改成只在 GitHub 上跑

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-09-30 00:04:16 +08:00
1 parent e393ffedf7
commit 2b4676ae34
2 files changed
+9 -3

No files matched your search

+6 -2
View File
@@ -7,11 +7,14 @@
# 服务器自己编的能力**没有砍掉**:docker/deploy.sh 不带 --prebuilt 就是原来的
# 行为(ARTIFACTS=build),只要机器上有 docker 就能手动部署,不依赖这个工作流。
#
# 触发的是 push 到 **github** 这个 remote(origin 是 git.xuyue.cc,平时那次
# push 不会触发):
# 触发的是 push 到 **github** 这个 remote:
#
# git push github main
#
# origin(git.xuyue.cc)是 Gitea,仓库里没有 .gitea/workflows 时它的 Actions 会退回来
# 读这份 .github/workflows,每次 push origin 都会把部署再跑一遍 —— 那边不需要。
# 所以下面 job 上卡了 server_url:只在 GitHub 上跑,Gitea 上直接跳过。
#
# 仓库 Settings → Secrets 需要两个:
# HOST 服务器地址
# KEY 能以 root 登录该服务器的私钥(完整 PEM,含首尾 BEGIN/END 行)
@@ -45,6 +48,7 @@ env:
jobs:
deploy:
if: github.server_url == 'https://github.com'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
+3 -1
View File
@@ -64,7 +64,9 @@ cd OJ2 && docker/deploy.sh # 马上重新部署,api / worker 带
`.github/workflows/deploy.yml` —— 在 runner 上编好产物、rsync 到服务器、在服务器上
跑 `docker/deploy.sh --prebuilt`。触发的是 push 到 **github** 这个 remote
(`origin` 是 `git.xuyue.cc`,平时那次 push 不触发):
(`origin` 是 `git.xuyue.cc`,平时那次 push 不触发 —— 那边是 Gitea,没有
`.gitea/workflows` 时它的 Actions 会退回来读这份工作流,所以 job 上卡了
`github.server_url == 'https://github.com'`,在 Gitea 上直接跳过):
```bash
git push github main