auto-merge.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. name: Automerge
  2. on:
  3. pull_request:
  4. types:
  5. - labeled
  6. - unlabeled
  7. - synchronize
  8. - opened
  9. - edited
  10. - ready_for_review
  11. - reopened
  12. - unlocked
  13. pull_request_review:
  14. types:
  15. - submitted
  16. status: {}
  17. jobs:
  18. # 合并发布版本的 pr 到 master
  19. auto-merge:
  20. runs-on: ubuntu-latest
  21. steps:
  22. - name: Automerge
  23. uses: 'pascalgn/automerge-action@v0.14.3'
  24. env:
  25. GITHUB_TOKEN: '${{ secrets.TOKEN }}'
  26. MERGE_LABELS: ''
  27. MERGE_FILTER_AUTHOR: 'kailong321200875'
  28. push-to-gh-pages:
  29. needs: [auto-merge]
  30. runs-on: ubuntu-latest
  31. steps:
  32. - name: Checkout
  33. uses: actions/checkout@v2
  34. - name: Setup Pnpm
  35. uses: pnpm/action-setup@v2
  36. with:
  37. version: latest
  38. - name: use Node.js 16
  39. uses: actions/setup-node@v2.1.2
  40. with:
  41. node-version: '16.x'
  42. - name: Set SSH Environment
  43. env:
  44. DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
  45. run: |
  46. mkdir -p ~/.ssh/
  47. echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
  48. chmod 600 ~/.ssh/id_rsa
  49. ssh-keyscan github.com > ~/.ssh/known_hosts
  50. chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
  51. git config --local user.email "321200875@qq.com"
  52. git config --local user.name "kailong321200875"
  53. # 发布到 github
  54. - name: Build Github
  55. run: |
  56. pnpm install --no-frozen-lockfile
  57. pnpm run build:pro
  58. - name: Deploy Github
  59. uses: peaceiris/actions-gh-pages@v3
  60. with:
  61. deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
  62. publish_branch: gh-pages
  63. publish_dir: ./dist-pro
  64. force_orphan: true
  65. cname: element-plus-admin.cn
  66. push-to-gh-pages-gitee:
  67. needs: [auto-merge]
  68. runs-on: ubuntu-latest
  69. steps:
  70. - name: Checkout
  71. uses: actions/checkout@v2
  72. - name: Setup Pnpm
  73. uses: pnpm/action-setup@v2
  74. with:
  75. version: latest
  76. - name: use Node.js 16
  77. uses: actions/setup-node@v2.1.2
  78. with:
  79. node-version: '16.x'
  80. - name: Set SSH Environment
  81. env:
  82. DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
  83. run: |
  84. mkdir -p ~/.ssh/
  85. echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
  86. chmod 600 ~/.ssh/id_rsa
  87. ssh-keyscan github.com > ~/.ssh/known_hosts
  88. chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
  89. git config --local user.email "321200875@qq.com"
  90. git config --local user.name "kailong321200875"
  91. - name: Build Gitee
  92. run: |
  93. pnpm install --no-frozen-lockfile
  94. pnpm run build:gitee
  95. # 发布到 gitee
  96. - name: Deploy Gitee
  97. uses: peaceiris/actions-gh-pages@v3
  98. with:
  99. deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
  100. publish_branch: gh-pages-gitee
  101. publish_dir: ./dist-pro
  102. force_orphan: true
  103. - name: Sync Github Repos To Gitee # 名字随便起
  104. uses: Yikun/hub-mirror-action@v1.1 # 使用Yikun/hub-mirror-action
  105. with:
  106. src: github/kailong321200875 # 源端账户名(github)
  107. dst: gitee/kailong110120130 # 目的端账户名(gitee)
  108. dst_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # SSH密钥对中的私钥
  109. dst_token: ${{ secrets.GITEE_TOKEN }} # Gitee账户的私人令牌
  110. account_type: user # 账户类型
  111. clone_style: 'https' # 使用https方式进行clone,也可以使用ssh
  112. debug: true # 启用后会显示所有执行命令
  113. force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
  114. static_list: 'vue-element-plus-admin' # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
  115. timeout: '600s' # git超时设置,超时后会自动重试git操作