11name : deploy-book
22
3+ # Run this when the master or main branch changes
34on :
4- # Trigger the workflow on push to main branch
55 push :
66 branches :
7+ - master
78 - main
8-
9- env :
10- BASE_URL : /${{ github.event.repository.name }}
11-
12- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
13- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
14- concurrency :
15- group : " pages"
16- cancel-in-progress : false
17-
9+ # If your git repository has the Jupyter Book within some-subfolder next to
10+ # unrelated files, you can make this run only if a file within that specific
11+ # folder has been modified.
12+ #
13+ # paths:
14+ # - some-subfolder/**
15+
16+ # This job installs dependencies, builds the book, and pushes it to `gh-pages`
1817jobs :
1918 deploy-book :
2019 runs-on : ubuntu-latest
21- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
2220 permissions :
2321 pages : write
2422 id-token : write
2523 steps :
26- - uses : actions/checkout@v4
27- with :
28- submodules : ' recursive'
24+ - uses : actions/checkout@v5
2925
3026 # Install dependencies
31- - name : Set up Python 3.11
32- uses : actions/setup-python@v5
27+ - name : Set up Python
28+ uses : actions/setup-python@v6
3329 with :
34- python-version : " 3.11 "
35- cache : pip # Implicitly depends upon requirements.txt
30+ python-version : " 3.13 "
31+ cache : pip # Implicitly uses requirements.txt for cache key
3632
3733 - name : Install dependencies
3834 run : pip install -r requirements.txt
3935
36+ # (optional) Cache your executed notebooks between runs
37+ # if you have config:
38+ # execute:
39+ # execute_notebooks: cache
40+ - name : cache executed notebooks
41+ uses : actions/cache@v4
42+ with :
43+ path : _build/.jupyter_cache
44+ key : jupyter-book-cache-${{ hashFiles('requirements.txt') }}
45+
4046 # Build the book
4147 - name : Build the book
42- run : jupyter-book build my_book/my_book
48+ run : |
49+ jupyter-book build .
50+
51+ # https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow
4352
4453 # Upload the book's HTML as an artifact
4554 - name : Upload artifact
46- uses : actions/upload-pages-artifact@v3
55+ uses : actions/upload-pages-artifact@v4
4756 with :
48- path : " my_book/my_book/ _build/html"
57+ path : _build/html
4958
5059 # Deploy the book's HTML to GitHub Pages
5160 - name : Deploy to GitHub Pages
5261 id : deployment
53- uses : actions/deploy-pages@v4
62+ uses : actions/deploy-pages@v4
0 commit comments