[pre-commit.ci] pre-commit autoupdate #127
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: docs | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Dependencies | |
run: | | |
if [ -f pyproject.toml ]; then pip install ".[docs]"; fi | |
- name: Clear notebooks and create conf.py file | |
run: | | |
jupyter-book config sphinx docs/ | |
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --clear-output --inplace $(find . -type f -name '*.ipynb') | |
- name: Build Sphinx Documentation | |
run: | | |
sphinx-build docs _build/html -b html | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' && job.status == 'success' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_build/html | |
enable_jekyll: false |