This commit is contained in:
2025-12-17 22:49:00 +08:00
parent 3b9d292d90
commit d8ee8f0cdd
2 changed files with 25 additions and 13 deletions

View File

@@ -33,7 +33,20 @@ main:
git_email: "xiongxiao@xiongxiao.me"
sync_mode: rebase
branch: main
web_trigger_sync_from_gitea:
- services:
- docker
imports:
- https://cnb.cool/kevisual/env/-/blob/main/env.yml
stages:
- name: '添加 gitea的origin'
script: |
git remote remove gitea 2>/dev/null || true
git remote add gitea https://oauth2:${GITEA_TOKEN}@git.xiongxiao.me/template/template.git
- name: '同步gitea代码到当前仓库'
script: git pull gitea main
- name: '提交到原本的origin'
script: git push origin main
"**":
@@ -41,15 +54,3 @@ main:
- stages:
- name: 执行任务
script: echo "job"
# .cnb/web_trigger.yml
branch:
# 如下按钮在分支名以 release 开头的分支详情页面显示
- reg: "^main"
buttons:
- name: 同步代码到gitea
desc: 同步代码到gitea
event: web_trigger_sync_to_gitea
- name: 同步gitea代码到当前仓库
desc: 同步gitea代码到当前仓库
event: web_trigger_sync_from_gitea

11
.cnb/web_trigger.yml Normal file
View File

@@ -0,0 +1,11 @@
# .cnb/web_trigger.yml
branch:
# 如下按钮在分支名以 release 开头的分支详情页面显示
- reg: "^main"
buttons:
- name: 同步代码到gitea
desc: 同步代码到gitea
event: web_trigger_sync_to_gitea
- name: 同步gitea代码到当前仓库
desc: 同步gitea代码到当前仓库
event: web_trigger_sync_from_gitea