Skip to content

doc workflow

doc workflow #1

name: Build the documentation
on:
workflow_dispatch:
push:
pull_request:
branches: [main]
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout the branch
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser
- name: Build the documentation with Sphinx
run: |
pip install -e .
sphinx-build -b html docs/source docs/build/html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
force_orphan: true