From c8ddb511cf086bb81c9cb0b3e7228e4aa421226c Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 16 Apr 2026 22:26:06 +0000 Subject: [PATCH] =?UTF-8?q?feat(ci):=20=E6=B7=BB=E5=8A=A0=20Gitee=20?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync-gitee.yml | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/sync-gitee.yml diff --git a/.github/workflows/sync-gitee.yml b/.github/workflows/sync-gitee.yml new file mode 100644 index 000000000..b4628f920 --- /dev/null +++ b/.github/workflows/sync-gitee.yml @@ -0,0 +1,45 @@ +name: "Sync to Gitee" + +# Required GitHub Secrets: +# +# GITEE_SSH_PRIVATE_KEY - SSH private key with push access to gitee.com/aipaw/dootask + +on: + workflow_run: + workflows: ["Publish"] + types: + - completed + +jobs: + sync: + name: Push to Gitee + if: github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup SSH key + env: + GITEE_SSH_PRIVATE_KEY: ${{ secrets.GITEE_SSH_PRIVATE_KEY }} + run: | + mkdir -p ~/.ssh + echo "$GITEE_SSH_PRIVATE_KEY" > ~/.ssh/gitee_key + chmod 600 ~/.ssh/gitee_key + cat >> ~/.ssh/config << EOF + Host gitee.com + HostName gitee.com + IdentityFile ~/.ssh/gitee_key + StrictHostKeyChecking no + EOF + + - name: Push to Gitee + run: | + git remote add gitee git@gitee.com:aipaw/dootask.git + git push gitee pro + + - name: Clean up + if: always() + run: rm -rf ~/.ssh/gitee_key