test by manually running the notebook #1
Workflow file for this run
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: autogenerate docs from tutorials | |
on: | |
# Triggers the workflow on push but only for the main branch | |
push: | |
branches: [ auto-doc-generation ] | |
paths: ['**.ipynb'] | |
jobs: | |
docs-from-tutorials: | |
runs-on: ubuntu-latest | |
steps: | |
# Check out repo and set up Python | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
# Use cached python and dependencies, install poetry | |
- name: "Setup Python, Poetry and Dependencies" | |
uses: packetcoders/action-setup-cache-python-poetry@main | |
with: | |
python-version: 3.8 | |
poetry-version: 1.2.2 | |
# Execute and convert notebooks | |
- name: execute notebooks | |
run: find tutorial -type f -name "*.ipynb" -exec jupyter nbconvert --execute --to notebook --inplace {} \; | |
- name: convert notebooks to rst and save to docs | |
run: find tutorial -type f -name "*.ipynb" -exec jupyter-nbconvert --to rst --output-dir docs/tutorial {} \; | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: 'Updating tutorial rsts for docs' | |
add: 'docs/tutorial/' |