Update README.md #81
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 | |
sudo apt-get install -y wkhtmltopdf | |
- name: create slides | |
run: | | |
jupyter nbconvert --to slides --embed-images --template reveal --output-dir docs/source/_static "notebooks/*.ipynb" | |
- name: Convert notebooks to PDF | |
run: | | |
for html_file in docs/source/_static/*.html; do | |
# Create the PDF file name from the HTML file name | |
pdf_file="${html_file%.html}.pdf" | |
# Convert HTML to PDF using wkhtmltopdf (or replace with google-chrome for headless conversion) | |
wkhtmltopdf --orientation landscape "$html_file" "$pdf_file" | |
done | |
- 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 |