This commit is contained in:
2026-01-05 10:50:37 +08:00
parent 2707286d7d
commit 2724f09a5b
6 changed files with 121 additions and 150 deletions

View File

@@ -12,16 +12,14 @@ $:
# - name: pnpm install
# 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}"
_common: &common_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:
@@ -33,21 +31,26 @@ main:
git_email: "xiongxiao@xiongxiao.me"
sync_mode: rebase
branch: main
_common: &common_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/kevisual/cnb.git
- name: '同步gitea代码到当前仓库'
script: git pull gitea main
- name: '提交到原本的origin'
script: git push origin main
main:
web_trigger_sync_to_gitea:
- <<: *common_sync_to_gitea
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/kevisual/cnb.git
- name: '同步gitea代码到当前仓库'
script: git pull gitea main
- name: '提交到原本的origin'
script: git push origin main
- <<: *common_sync_from_gitea
api_trigger_test:
- stages:
- name: test