auto-merge.yml 5.4 KB

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