diff --git a/.cnb.yaml b/.cnb.yaml index b6db1b4..363edc4 100644 --- a/.cnb.yaml +++ b/.cnb.yaml @@ -10,4 +10,34 @@ $: # 开发环境启动后会执行的任务 # stages: # - name: pnpm install - # script: pnpm install \ No newline at end of file + # script: pnpm install + + +main: + web_trigger_sync_to_gitea: + - services: + - docker + imports: + - https://cnb.cool/kevisual/env/-/blob/main/env.yml + stages: + - name: 'show username' + script: echo "GITEA_USERNAME is ${GITEA_USERNAME} and GITEA_PASSWORD is ${GITEA_PASSWORD}" + - name: sync to gitea + image: tencentcom/git-sync + settings: + target_url: https://git.xiongxiao.me/kevisual/cnb.git + auth_type: https + username: "oauth2" + password: ${GITEA_TOKEN} + git_user: "abearxiong" + git_email: "xiongxiao@xiongxiao.me" + sync_mode: rebase + branch: main + + + +"**": + web_trigger_test: + - stages: + - name: 执行任务 + script: echo "job" \ No newline at end of file diff --git a/.cnb/web_trigger.yml b/.cnb/web_trigger.yml new file mode 100644 index 0000000..d5964d5 --- /dev/null +++ b/.cnb/web_trigger.yml @@ -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 \ No newline at end of file