Skip to content

Commit 44c255a

Browse files
authored
Merge pull request #45 from nipreps/codex/generate-jupyter-notebooks-from-tutorial
Automate tutorial notebook generation
2 parents c428c58 + 0415402 commit 44c255a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/book.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,22 @@ jobs:
7070
with:
7171
github_token: ${{ secrets.GITHUB_TOKEN }}
7272
publish_dir: ./docs/_build/html
73+
74+
- name: Generate tutorial notebooks
75+
run: |
76+
pixi run python -m jupytext docs/tutorial/intro.md --to ipynb -o docs/notebook/01-intro.ipynb
77+
pixi run python -m jupytext docs/tutorial/data.md --to ipynb -o docs/notebook/02-data.ipynb
78+
pixi run python -m jupytext docs/tutorial/models.md --to ipynb -o docs/notebook/03-models.ipynb
79+
pixi run python -m jupytext docs/tutorial/registration.md --to ipynb -o docs/notebook/04-registration.ipynb
80+
pixi run python -m jupytext docs/tutorial/solution.md --to ipynb -o docs/notebook/05-solution.ipynb
81+
82+
- name: Commit updated notebooks
83+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
84+
run: |
85+
if [[ -n "$(git status --porcelain docs/notebook/*.ipynb)" ]]; then
86+
git config user.name "github-actions[bot]"
87+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
88+
git add docs/notebook/*.ipynb
89+
git commit -m "Update tutorial notebooks"
90+
git push
91+
fi

0 commit comments

Comments
 (0)