chore(deploy): 修复生产环境关键问题并增强系统功能 #21
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: Mirror to Gitee & Gitcode | |
| on: | |
| push: | |
| branches: [main, master] | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| mirror: | |
| name: Mirror Code | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'qinshihu/itops-agent-platform' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Git | |
| run: | | |
| git config --global user.name "qinshihu" | |
| git config --global user.email "huawei_network@foxmail.com" | |
| - name: Push to Gitee | |
| env: | |
| GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }} | |
| run: | | |
| echo "Setting up Gitee remote..." | |
| git remote add gitee https://oauth2:${GITEE_TOKEN}@gitee.com/IT_Oline/itops-agent-platform.git || git remote set-url gitee https://oauth2:${GITEE_TOKEN}@gitee.com/IT_Oline/itops-agent-platform.git | |
| echo "Pushing branches to Gitee..." | |
| git push gitee main --force --verbose 2>&1 | |
| echo "Pushing tags to Gitee..." | |
| git push gitee --tags --force --verbose 2>&1 | |
| echo "Gitee sync completed!" | |
| - name: Push to Gitcode | |
| env: | |
| GITCODE_TOKEN: ${{ secrets.GITCODE_TOKEN }} | |
| run: | | |
| echo "Setting up Gitcode remote..." | |
| git remote add gitcode https://oauth2:${GITCODE_TOKEN}@gitcode.com/gcw_IM7aAihp/itops-agent-platform.git || git remote set-url gitcode https://oauth2:${GITCODE_TOKEN}@gitcode.com/gcw_IM7aAihp/itops-agent-platform.git | |
| echo "Pushing branches to Gitcode..." | |
| git push gitcode main --force --verbose 2>&1 | |
| echo "Pushing tags to Gitcode..." | |
| git push gitcode --tags --force --verbose 2>&1 | |
| echo "Gitcode sync completed!" |