auto-merge.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. contrib-readme-en-job:
  29. needs: [auto-merge]
  30. runs-on: ubuntu-latest
  31. name: A job to automate contrib in readme
  32. steps:
  33. - name: Contribute List
  34. uses: akhilmhdh/contributors-readme-action@v2.3.4
  35. env:
  36. GITHUB_TOKEN: ${{ secrets.CONTRIBUTORS_TOKEN }}
  37. contrib-readme-job:
  38. needs: [auto-merge, contrib-readme-en-job]
  39. runs-on: ubuntu-latest
  40. name: A job to automate contrib in readme.zh-CN
  41. steps:
  42. - name: Contribute List
  43. uses: akhilmhdh/contributors-readme-action@v2.3.4
  44. with:
  45. readme_path: README.zh-CN.md
  46. env:
  47. GITHUB_TOKEN: ${{ secrets.CONTRIBUTORS_TOKEN }}
  48. push-to-gh-pages:
  49. needs: [auto-merge]
  50. runs-on: ubuntu-latest
  51. steps:
  52. - name: Checkout
  53. uses: actions/checkout@v2
  54. - name: Setup Pnpm
  55. uses: pnpm/action-setup@v2
  56. with:
  57. version: latest
  58. - name: use Node.js 16
  59. uses: actions/setup-node@v2.1.2
  60. with:
  61. node-version: '16.x'
  62. - name: Cache ~/.pnpm-store
  63. uses: actions/cache@v3
  64. env:
  65. cache-name: cache-pnpm-store
  66. with:
  67. path: ~/.pnpm-store
  68. key: ${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
  69. restore-keys: |
  70. ${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-
  71. ${{ runner.os }}-${{ matrix.node-version }}-test-
  72. ${{ runner.os }}-
  73. - name: Set SSH Environment
  74. env:
  75. DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
  76. run: |
  77. mkdir -p ~/.ssh/
  78. echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
  79. chmod 600 ~/.ssh/id_rsa
  80. ssh-keyscan github.com > ~/.ssh/known_hosts
  81. chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
  82. git config --local user.email "321200875@qq.com"
  83. git config --local user.name "kailong321200875"
  84. # 发布到github
  85. - name: Build Github
  86. run: |
  87. pnpm install
  88. pnpm run build:pro
  89. - name: Deploy Github
  90. uses: peaceiris/actions-gh-pages@v3
  91. with:
  92. deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
  93. publish_branch: gh-pages
  94. publish_dir: ./dist-pro
  95. force_orphan: true
  96. cname: element-plus-admin.cn
  97. push-to-gh-pages-gitee:
  98. needs: [auto-merge]
  99. runs-on: ubuntu-latest
  100. steps:
  101. - name: Checkout
  102. uses: actions/checkout@v2
  103. - name: Setup Pnpm
  104. uses: pnpm/action-setup@v2
  105. with:
  106. version: latest
  107. - name: use Node.js 16
  108. uses: actions/setup-node@v2.1.2
  109. with:
  110. node-version: '16.x'
  111. - name: Cache ~/.pnpm-store
  112. uses: actions/cache@v3
  113. env:
  114. cache-name: cache-pnpm-store
  115. with:
  116. path: ~/.pnpm-store
  117. key: ${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
  118. restore-keys: |
  119. ${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-
  120. ${{ runner.os }}-${{ matrix.node-version }}-test-
  121. ${{ runner.os }}-
  122. - name: Set SSH Environment
  123. env:
  124. DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
  125. run: |
  126. mkdir -p ~/.ssh/
  127. echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
  128. chmod 600 ~/.ssh/id_rsa
  129. ssh-keyscan github.com > ~/.ssh/known_hosts
  130. chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
  131. git config --local user.email "321200875@qq.com"
  132. git config --local user.name "kailong321200875"
  133. - name: Build Gitee
  134. run: |
  135. pnpm install
  136. pnpm run build:gitee
  137. # 发布到gitee
  138. - name: Deploy Gitee
  139. uses: peaceiris/actions-gh-pages@v3
  140. with:
  141. deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
  142. publish_branch: gh-pages-gitee
  143. publish_dir: ./dist-pro
  144. force_orphan: true
  145. - name: Sync Github Repos To Gitee # 名字随便起
  146. uses: Yikun/hub-mirror-action@v1.1 # 使用Yikun/hub-mirror-action
  147. with:
  148. src: github/kailong321200875 # 源端账户名(github)
  149. dst: gitee/kailong110120130 # 目的端账户名(gitee)
  150. dst_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # SSH密钥对中的私钥
  151. dst_token: ${{ secrets.GITEE_TOKEN }} # Gitee账户的私人令牌
  152. account_type: user # 账户类型
  153. clone_style: 'https' # 使用https方式进行clone,也可以使用ssh
  154. debug: true # 启用后会显示所有执行命令
  155. force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
  156. static_list: 'vue-element-plus-admin' # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
  157. timeout: '600s' # git超时设置,超时后会自动重试git操作