deploy-gitee.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: Deploy Gitee
  2. on:
  3. push:
  4. branches:
  5. - master
  6. jobs:
  7. push-to-gh-pages-gitee:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout
  11. uses: actions/checkout@v2
  12. - name: Use Node.js 16
  13. uses: actions/setup-node@v2.1.2
  14. with:
  15. node-version: '16.x'
  16. - name: Get Yarn Cache
  17. id: yarn-cache
  18. run: echo "::set-output name=dir::$(yarn cache dir)"
  19. - name: Cache Dependencies
  20. uses: actions/cache@v2
  21. with:
  22. path: ${{ steps.yarn-cache.outputs.dir }}
  23. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  24. restore-keys: |
  25. ${{ runner.os }}-yarn-
  26. - name: Set SSH Environment
  27. env:
  28. DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
  29. run: |
  30. mkdir -p ~/.ssh/
  31. echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
  32. chmod 600 ~/.ssh/id_rsa
  33. ssh-keyscan github.com > ~/.ssh/known_hosts
  34. chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
  35. git config --local user.email "321200875@qq.com"
  36. git config --local user.name "kailong321200875"
  37. - name: Build
  38. run: |
  39. yarn install
  40. yarn run build:gitee
  41. - name: Deploy Gitee
  42. uses: peaceiris/actions-gh-pages@v3
  43. with:
  44. deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
  45. publish_branch: gh-pages-gitee
  46. publish_dir: ./dist-pro
  47. force_orphan: true
  48. - name: Sync Github Repos To Gitee # 名字随便起
  49. uses: Yikun/hub-mirror-action@v1.1 # 使用Yikun/hub-mirror-action
  50. with:
  51. src: github/kailong321200875 # 源端账户名(github)
  52. dst: gitee/kailong110120130 # 目的端账户名(gitee)
  53. dst_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # SSH密钥对中的私钥
  54. dst_token: ${{ secrets.GITEE_TOKEN }} # Gitee账户的私人令牌
  55. account_type: user # 账户类型
  56. clone_style: 'https' # 使用https方式进行clone,也可以使用ssh
  57. debug: true # 启用后会显示所有执行命令
  58. force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
  59. static_list: 'vue-element-plus-admin' # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
  60. timeout: '600s' # git超时设置,超时后会自动重试git操作