Sync to Gitee #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync to Gitee | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_run: | |
| workflows: [ "Deploy" ] | |
| types: | |
| - completed | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code # 先检出当前代码,确保工作区存在 | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # 获取所有历史,而不是浅克隆 | |
| - name: Mirror to Gitee | |
| uses: wearerequired/git-mirror-action@v1 | |
| with: | |
| # 显式指定源仓库(当前仓库的地址) | |
| source-repo: https://github.com/${{ github.repository }}.git | |
| # 显式指定目标仓库(你的Gitee仓库地址) | |
| destination-repo: https://${{ secrets.GITEE_USERNAME }}:${{ secrets.GITEE_PRIVATE_TOKEN }}@gitee.com/${{ secrets.GITEE_USERNAME }}/site.git |