main.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. - name: cp funasr
  16. if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh'
  17. run: |
  18. ln -s funasr ./
  19. - uses: ammaraskar/sphinx-action@master
  20. with:
  21. docs-folder: "docs/"
  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 sphinx-markdown-tables nbsphinx jinja2 recommonmark sphinx_rtd_theme myst-parser"
  27. - name: deploy copy
  28. if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh'
  29. run: |
  30. mkdir public
  31. touch public/.nojekyll
  32. mkdir public/en
  33. touch public/en/.nojekyll
  34. cp -r docs/_build/html/* public/en/
  35. mkdir public/m2met2
  36. touch public/m2met2/.nojekyll
  37. cp -r docs/m2met2/_build/html/* public/m2met2/
  38. - name: deploy github.io pages
  39. if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh'
  40. uses: peaceiris/actions-gh-pages@v2.3.1
  41. env:
  42. GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
  43. PUBLISH_BRANCH: gh-pages
  44. PUBLISH_DIR: public