Update docs.yml #76
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 | |
jobs: | |
build_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: install dependencies | |
run: pip install -r ./docs/requirements.txt | |
- name: create slides and PDF | |
run: | | |
jupyter nbconvert --to slides --embed-images --template reveal --output-dir docs/source/_static "notebooks/*.ipynb" | |
jupyter nbconvert --to pdf --output-dir docs/source/_static "notebooks/*.pdf" | |
- name: convert md to rst # md reference is not recognized with md_include | |
uses: docker://pandoc/core:latest | |
with: | |
args: --from=markdown --to=rst --output=docs/source/README.rst README.md | |
- name: build docs | |
run: | | |
sphinx-build -W -b html docs/source docs/build -j auto | |
- name: deploy docs only if it is pushed to main | |
uses: peaceiris/actions-gh-pages@v3 | |
# publish every time there's a push to the 2024 branch | |
if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/build | |
force_orphan: true |