update workflow #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation | |
on: | |
push: | |
branches: | |
- xiaoyi_doc | |
workflow_dispatch: | |
permissions: # This sets permissions for all jobs | |
contents: write | |
actions: read | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: List docs directory | |
run: ls -l ./docs | |
- name: Display requirements.txt | |
run: cat ./docs/requirements.txt | |
- name: Install dependencies | |
run: | | |
pip install -r ./docs/requirements.txt | |
pip freeze | |
- name: Sphinx build | |
run: | | |
sphinx-build -b html docs/source/ docs/build/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/xiaoyi_doc' }} | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/build/ | |
force_orphan: true |