main.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: "FunASR Docs"
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. push:
  7. branches:
  8. - main
  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/m2met2/"
  22. pre-build-command: "pip install sphinx-markdown-tables nbsphinx jinja2 recommonmark sphinx_rtd_theme myst-parser"
  23. - name: deploy copy
  24. if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh' || github.ref == 'refs/heads/dev_lhn'
  25. run: |
  26. mkdir public
  27. touch public/.nojekyll
  28. mkdir public/en
  29. touch public/en/.nojekyll
  30. cp -r docs/_build/html/* public/en/
  31. mkdir public/m2met2
  32. touch public/m2met2/.nojekyll
  33. cp -r docs/m2met2/_build/html/* public/m2met2/
  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' || github.ref == 'refs/heads/dev_lhn'
  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