From 272139496b92ef47a436c22002929d6ec726ad6e Mon Sep 17 00:00:00 2001 From: CJK_mkp <113243675+CJKmkp@users.noreply.github.com> Date: Sat, 31 May 2025 11:32:03 +0800 Subject: [PATCH] Create sync-to-gitea.yml --- .github/workflows/sync-to-gitea.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/sync-to-gitea.yml diff --git a/.github/workflows/sync-to-gitea.yml b/.github/workflows/sync-to-gitea.yml new file mode 100644 index 00000000..41d89651 --- /dev/null +++ b/.github/workflows/sync-to-gitea.yml @@ -0,0 +1,27 @@ +name: Sync to Gitea + +on: + push: + branches: [ main ] + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Push to Gitea + env: + GITEA_REPO: ${{ secrets.GITEA_REPO_URL }} + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + git config --global user.name "GitHub Action" + git config --global user.email "action@github.com" + + # 使用 token 认证的正确格式 + git remote add gitea https://${{ secrets.GITEA_TOKEN }}git@gitea.com:CJKmkp/ICC-CE.git + + # 推送代码到 Gitea + git push -u gitea --all + git push -u gitea --tags