deploy-gitee.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Deploy Gitee
  2. on:
  3. push:
  4. branches:
  5. - master
  6. jobs:
  7. push-to-gh-pages:
  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
  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. keep_files: true