ci: 触发分支改为 main(提交或合并入 main 才部署)

- deploy.yml 触发条件 dev → main;PR 合并进 main 产生的 push 同样覆盖
- 文档同步:日常开发走 dev,合并 main 才上线

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-17 13:43:46 +08:00
parent a6257d2fc4
commit 41f3fb7fb0
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -1,8 +1,9 @@
name: build-and-deploy name: build-and-deploy
on: on:
# 仅 main 有提交(含 PR 合并入 main)时触发
push: push:
branches: [dev] branches: [main]
workflow_dispatch: workflow_dispatch:
env: env:
+3 -2
View File
@@ -3,7 +3,7 @@
## 拓扑 ## 拓扑
``` ```
push dev ──▶ Gitea(192.168.100.125:3000) push/merge main ─▶ Gitea(192.168.100.125:3000)
│ 触发 .gitea/workflows/deploy.yml │ 触发 .gitea/workflows/deploy.yml
act_runner(192.168.100.128) act_runner(192.168.100.128)
@@ -52,7 +52,8 @@ vi .env # 改 admin 密码、JWT 密钥
## 日常 ## 日常
- push 到 `dev` 分支自动构建部署;也可在 Gitea Actions 页手动 `workflow_dispatch` - 提交或合并到 `main` 分支自动构建部署;也可在 Gitea Actions 页手动 `workflow_dispatch`
- 日常开发在 `dev` 分支,PR 合并进 `main` 才触发上线
- 回滚:132 上 `docker tag` 保留的旧镜像,或重跑上一次成功的 commit - 回滚:132 上 `docker tag` 保留的旧镜像,或重跑上一次成功的 commit
- 查日志:`docker logs -f sundynix-site` - 查日志:`docker logs -f sundynix-site`
- 本地手动出包(不走 CI):仓库根 `docker build -t sundynix-site:latest .` - 本地手动出包(不走 CI):仓库根 `docker build -t sundynix-site:latest .`