diff --git a/.cnb.yml b/.cnb.yml index c01987c..d469410 100644 --- a/.cnb.yml +++ b/.cnb.yml @@ -1,4 +1,14 @@ # .cnb.yml +include: + - https://cnb.cool/kevisual/cnb/-/blob/main/.cnb/template.yml + +.common_env: &common_env + env: + TO_REPO: template/vite-react-template + TO_URL: git.xiongxiao.me + imports: + - https://cnb.cool/kevisual/env/-/blob/main/.env.development + $: vscode: - docker: @@ -6,8 +16,29 @@ $: services: - vscode - docker - imports: https://cnb.cool/kevisual/env/-/blob/main/env.yml + imports: !reference [.common_env, imports] # 开发环境启动后会执行的任务 - stages: - - name: pnpm install - script: pnpm install \ No newline at end of file + # stages: + # - name: pnpm install + # script: pnpm install + stages: !reference [.dev_template, stages] + +.common_sync_to_gitea: &common_sync_to_gitea + - <<: *common_env + services: !reference [.common_sync_to_gitea_template, services] + stages: !reference [.common_sync_to_gitea_template, stages] + +.common_sync_from_gitea: &common_sync_from_gitea + - <<: *common_env + services: !reference [.common_sync_from_gitea_template, services] + stages: !reference [.common_sync_from_gitea_template, stages] + +main: + web_trigger_sync_to_gitea: + - <<: *common_sync_to_gitea + web_trigger_sync_from_gitea: + - <<: *common_sync_from_gitea + api_trigger_sync_to_gitea: + - <<: *common_sync_to_gitea + api_trigger_sync_from_gitea: + - <<: *common_sync_from_gitea \ No newline at end of file diff --git a/.cnb/web_trigger.yml b/.cnb/web_trigger.yml new file mode 100644 index 0000000..7194675 --- /dev/null +++ b/.cnb/web_trigger.yml @@ -0,0 +1,11 @@ +# .cnb/web_trigger.yml +branch: + # 如下按钮在分支名以 release 开头的分支详情页面显示 + - reg: "^main" + buttons: + - name: 同步代码到gitea + description: 同步代码到gitea + event: web_trigger_sync_to_gitea + - name: 同步gitea代码到当前仓库 + description: 同步gitea代码到当前仓库 + event: web_trigger_sync_from_gitea \ No newline at end of file diff --git a/.env.development b/.env.example similarity index 100% rename from .env.development rename to .env.example diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml deleted file mode 100644 index df1f226..0000000 --- a/.github/workflows/git-sync.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Sync to CNB -on: [push] - -jobs: - sync: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Sync to CNB Repository - run: | - docker run --rm \ - -v ${{ github.workspace }}:${{ github.workspace }} \ - -w ${{ github.workspace }} \ - -e PLUGIN_TARGET_URL="https://cnb.cool/kevisual/vite-react-template.git" \ - -e PLUGIN_AUTH_TYPE="https" \ - -e PLUGIN_USERNAME="cnb" \ - -e PLUGIN_PASSWORD=${{ secrets.GIT_PASSWORD }} \ - -e PLUGIN_SYNC_MODE="rebase" \ - tencentcom/git-sync \ No newline at end of file diff --git a/.gitignore b/.gitignore index a65168f..9065d26 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,9 @@ tsconfig.node.tsbuildinfo .turbo -.pnpm-store \ No newline at end of file +.pnpm-store + +.tanstack +.env + +!.env.example \ No newline at end of file diff --git a/public/demo.html b/public/demo.html index f478e55..263fc86 100644 --- a/public/demo.html +++ b/public/demo.html @@ -4,7 +4,7 @@
- +