auto-merge.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. automerge:
  19. runs-on: ubuntu-latest
  20. steps:
  21. - name: Automerge
  22. uses: 'pascalgn/automerge-action@v0.14.3'
  23. env:
  24. GITHUB_TOKEN: '${{ secrets.TOKEN }}'
  25. MERGE_LABELS: ''
  26. MERGE_FILTER_AUTHOR: 'kailong321200875'
  27. - name: Checkout
  28. uses: actions/checkout@v2
  29. - name: Use Node.js 16
  30. uses: actions/setup-node@v2.1.2
  31. with:
  32. node-version: '16.x'
  33. - name: Get Yarn Cache
  34. id: yarn-cache
  35. run: echo "::set-output name=dir::$(yarn cache dir)"
  36. - name: Cache Dependencies
  37. uses: actions/cache@v2
  38. with:
  39. path: ${{ steps.yarn-cache.outputs.dir }}
  40. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  41. restore-keys: |
  42. ${{ runner.os }}-yarn-
  43. - name: Set SSH Environment
  44. env:
  45. DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
  46. run: |
  47. mkdir -p ~/.ssh/
  48. echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
  49. chmod 600 ~/.ssh/id_rsa
  50. ssh-keyscan github.com > ~/.ssh/known_hosts
  51. chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
  52. git config --local user.email "321200875@qq.com"
  53. git config --local user.name "kailong321200875"
  54. - name: Build Gitee
  55. run: |
  56. yarn install
  57. yarn run build:gitee
  58. - name: Deploy Gitee
  59. uses: peaceiris/actions-gh-pages@v3
  60. with:
  61. deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
  62. publish_branch: gh-pages-gitee
  63. publish_dir: ./dist-pro
  64. force_orphan: true
  65. - name: Set SSH Environment
  66. env:
  67. DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
  68. run: |
  69. mkdir -p ~/.ssh/
  70. echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
  71. chmod 600 ~/.ssh/id_rsa
  72. ssh-keyscan github.com > ~/.ssh/known_hosts
  73. chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
  74. git config --local user.email "321200875@qq.com"
  75. git config --local user.name "kailong321200875"
  76. - name: Build Github
  77. run: |
  78. yarn run build:pro
  79. - name: Deploy
  80. uses: peaceiris/actions-gh-pages@v3
  81. with:
  82. deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
  83. publish_branch: gh-pages
  84. publish_dir: ./dist-pro
  85. force_orphan: true
  86. cname: element-plus-admin.cn
  87. - name: Sync Github Repos To Gitee # 名字随便起
  88. uses: Yikun/hub-mirror-action@v1.1 # 使用Yikun/hub-mirror-action
  89. with:
  90. src: github/kailong321200875 # 源端账户名(github)
  91. dst: gitee/kailong110120130 # 目的端账户名(gitee)
  92. dst_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # SSH密钥对中的私钥
  93. dst_token: ${{ secrets.GITEE_TOKEN }} # Gitee账户的私人令牌
  94. account_type: user # 账户类型
  95. clone_style: 'https' # 使用https方式进行clone,也可以使用ssh
  96. debug: true # 启用后会显示所有执行命令
  97. force_update: true # 启用后,强制同步,即强制覆盖目的端仓库
  98. static_list: 'vue-element-plus-admin' # 静态同步列表,在此填写需要同步的仓库名称,可填写多个
  99. timeout: '600s' # git超时设置,超时后会自动重试git操作