main.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_wjm'
  24. run: |
  25. mkdir public
  26. touch public/.nojekyll
  27. mkdir public/en
  28. touch public/en/.nojekyll
  29. cp -r docs/_build/html/* public/en/
  30. mkdir public/cn
  31. touch public/cn/.nojekyll
  32. cp -r docs_cn/_build/html/* public/cn/
  33. - name: deploy github.io pages
  34. if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm'
  35. uses: peaceiris/actions-gh-pages@v2.3.1
  36. env:
  37. GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
  38. PUBLISH_BRANCH: gh-pages
  39. PUBLISH_DIR: public