main.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: "FunASR Docs"
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. push:
  7. branches:
  8. - dev_wjm
  9. - main
  10. - dev_lyh
  11. jobs:
  12. docs:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v1
  16. - uses: ammaraskar/sphinx-action@master
  17. with:
  18. docs-folder: "docs/"
  19. pre-build-command: "pip install sphinx-markdown-tables nbsphinx jinja2 recommonmark sphinx_rtd_theme"
  20. - name: deploy copy
  21. if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh'
  22. run: |
  23. mkdir public
  24. touch public/.nojekyll
  25. mkdir public/en
  26. touch public/en/.nojekyll
  27. cp -r docs/_build/html/* public/en/
  28. mkdir public/m2met2
  29. touch public/m2met2/.nojekyll
  30. cp -r docs/m2met2/_build/html/* public/m2met2/
  31. mkdir public/m2met2_cn
  32. touch public/m2met2_cn/.nojekyll
  33. cp -r docs/m2met2_cn/_build/html/* public/m2met2_cn/
  34. - name: deploy github.io pages
  35. if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh'
  36. uses: peaceiris/actions-gh-pages@v2.3.1
  37. env:
  38. GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
  39. PUBLISH_BRANCH: gh-pages
  40. PUBLISH_DIR: public