deploy.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: deploy docs to server
  2. on:
  3. push:
  4. branches: [ master ]
  5. env:
  6. TZ: Asia/Shanghai
  7. jobs:
  8. build:
  9. strategy:
  10. matrix:
  11. node-version: [14.x]
  12. os: [ubuntu-latest]
  13. include:
  14. - os: ubuntu-latest
  15. path: ~/.cache/pip
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v2
  19. - name: Set up Python 3.8
  20. id: setup-python
  21. uses: actions/setup-python@v2
  22. with:
  23. python-version: 3.8
  24. - name: Install dependencies
  25. run: |
  26. python -m pip install --upgrade pip
  27. if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  28. - name: build docs
  29. run: |
  30. pwd
  31. sh tools/build_docs.sh
  32. # docs/.vuepress/dist
  33. - name: deploy to server
  34. uses: appleboy/scp-action@master
  35. with:
  36. host: ${{ secrets.HOST }}
  37. username: ${{ secrets.USERNAME }}
  38. port: ${{ secrets.PORT }}
  39. password: ${{ secrets.PASSWORD }}
  40. source: "site/"
  41. target: ${{ secrets.TARGET }}
  42. - name: User Nodejs
  43. uses: actions/setup-node@v1
  44. with:
  45. node-version: ${{ matrix.node-version }}
  46. - name: build
  47. run: |
  48. npm install
  49. npm run build
  50. npm run deploy