main.yml 1.2 KB

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