main.yml 2.0 KB

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