|
5 | 5 | branches: |
6 | 6 | - main |
7 | 7 |
|
8 | | -# This job installs dependencies, build the book, and pushes it to `gh-pages` |
| 8 | +env: |
| 9 | + BASE_URL: /${{ github.event.repository.name }} |
| 10 | + |
| 11 | +# Set GITHUB_TOKEN permissions to allow deployment to GitHub Pages |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + pages: write |
| 15 | + id-token: write |
| 16 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 17 | +# Do NOT cancel in-progress runs (allow these production deployments to complete). |
| 18 | +concurrency: |
| 19 | + group: "pages" |
| 20 | + cancel-in-progress: false |
9 | 21 | jobs: |
10 | | - deploy-book: |
| 22 | + deploy: |
| 23 | + environment: |
| 24 | + name: github-pages |
| 25 | + url: ${{ steps.deployment.outputs.page_url }} |
11 | 26 | runs-on: ubuntu-latest |
12 | 27 | steps: |
13 | | - - uses: actions/checkout@v2 |
14 | | - |
15 | | - # Install dependencies |
| 28 | + - uses: actions/checkout@v6 |
| 29 | + - name: Setup Pages |
| 30 | + uses: actions/configure-pages@v6 |
16 | 31 | - name: Set up Python 3.14 |
17 | 32 | uses: actions/setup-python@v6 |
18 | 33 | with: |
19 | | - python-version: "3.14" |
20 | | - |
| 34 | + python-version: "3.14" |
21 | 35 | - name: Install dependencies |
22 | 36 | run: | |
23 | | - pip install jupyter-book |
24 | | -
|
| 37 | + python -m pip install --upgrade pip |
| 38 | + pip install jupyter-book |
25 | 39 | - name: Build the book |
26 | 40 | run: | |
27 | | - jupyter-book build notebooks |
28 | | -
|
29 | | - - name: GitHub Pages action |
30 | | - uses: peaceiris/actions-gh-pages@v4.0.0 |
| 41 | + cd notebooks |
| 42 | + jupyter-book build --html |
| 43 | + - name: Upload artifact |
| 44 | + uses: actions/upload-pages-artifact@v5 |
31 | 45 | with: |
32 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
33 | | - publish_dir: notebooks/_build/html |
| 46 | + path: "notebooks/_build/html" |
| 47 | + - name: Deploy to GitHub Pages |
| 48 | + id: deployment |
| 49 | + uses: actions/deploy-pages@v5 |
0 commit comments