Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,22 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html

- name: Generate tutorial notebooks
run: |
pixi run python -m jupytext docs/tutorial/intro.md --to ipynb -o docs/notebook/01-intro.ipynb
pixi run python -m jupytext docs/tutorial/data.md --to ipynb -o docs/notebook/02-data.ipynb
pixi run python -m jupytext docs/tutorial/models.md --to ipynb -o docs/notebook/03-models.ipynb
pixi run python -m jupytext docs/tutorial/registration.md --to ipynb -o docs/notebook/04-registration.ipynb
pixi run python -m jupytext docs/tutorial/solution.md --to ipynb -o docs/notebook/05-solution.ipynb

- name: Commit updated notebooks
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
if [[ -n "$(git status --porcelain docs/notebook/*.ipynb)" ]]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs/notebook/*.ipynb
git commit -m "Update tutorial notebooks"
git push
Comment on lines +86 to +90

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ensure push step handles remote updates

The new auto-commit step pushes notebook changes straight to main without first rebasing or fetching. If someone else pushes to main while this workflow run is still executing, git push will fail with a non-fast-forward error and the entire deploy job will be marked failed even though notebook generation succeeded. Consider pulling with rebase (or skipping the commit) when the local branch is behind to avoid sporadic deployment failures.

Useful? React with 👍 / 👎.

fi
Loading