Skip to content

Commit 3dbcbe7

Browse files
committed
Update config files and deplyment scripts
This update makes sure that jupyterbook v1 is used to build the webpage. The current files do not work well with jupyterbook v2.
1 parent 63eaba2 commit 3dbcbe7

File tree

3 files changed

+59
-19
lines changed

3 files changed

+59
-19
lines changed

.github/workflows/publish-book.yml

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,47 @@ on:
55

66
# workflow_dispatch:
77
push:
8-
branches:
9-
- jupyterbook
8+
branches: [main]
109
# # If your git repository has the Jupyter Book within some-subfolder next to
1110
# # unrelated files, you can make this run only if a file within that specific
1211
# # folder has been modified.
1312
# #
1413
# # paths:
1514
# # - some-subfolder/**
1615

16+
env:
17+
# `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from.
18+
# E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`.
19+
# If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`.
20+
BASE_URL: /${{ github.event.repository.name }}
21+
22+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
23+
permissions:
24+
contents: read
25+
pages: write
26+
id-token: write
27+
28+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
29+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
30+
concurrency:
31+
group: 'pages'
32+
cancel-in-progress: false
33+
1734
# This job installs dependencies, builds the book, and pushes it to `gh-pages`
1835
jobs:
1936
deploy-book:
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
2040
runs-on: ubuntu-latest
2141
steps:
22-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v4
2343

24-
# Install dependencies
25-
- name: Set up Python 3.8
26-
uses: actions/setup-python@v1
44+
# Install dependencies to process page files
45+
- name: Set up Python 3.13
46+
uses: actions/setup-python@v6
2747
with:
28-
python-version: 3.8
48+
python-version: '3.13'
2949

3050
- name: Install dependencies
3151
run: |
@@ -34,15 +54,35 @@ jobs:
3454
- name: Process files
3555
run: |
3656
python ci/process_files.py
37-
57+
58+
# setup pages, build book, and deploy
59+
- name: Setup Pages
60+
uses: actions/configure-pages@v3
61+
# - uses: actions/setup-node@v4
62+
# with:
63+
# node-version: 18.x
64+
# - name: Install Jupyter Book (via myst)
65+
# run: npm install -g jupyter-book
66+
- name: Build HTML Assets
67+
run: jupyter-book build .
68+
69+
# run: jupyter-book build --html
70+
- name: Upload artifact
71+
uses: actions/upload-pages-artifact@v3
72+
with:
73+
path: './_build/html'
74+
- name: Deploy to GitHub Pages
75+
id: deployment
76+
uses: actions/deploy-pages@v4
77+
3878
# Build the book
39-
- name: Build the book
40-
run: |
41-
jupyter-book build .
79+
# - name: Build the book
80+
# run: |
81+
# jupyter-book build .
4282

4383
# Push the book's HTML to github-pages
44-
- name: GitHub Pages action
45-
uses: peaceiris/[email protected]
46-
with:
47-
github_token: ${{ secrets.GITHUB_TOKEN }}
48-
publish_dir: ./_build/html
84+
# - name: GitHub Pages action
85+
# uses: peaceiris/[email protected]
86+
# with:
87+
# github_token: ${{ secrets.GITHUB_TOKEN }}
88+
# publish_dir: ./_build/html

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Book settings
88
title : Mathematical Tools for Neuroscientists # The title of the book. Will be placed in the left navbar.
99
author : Ella Batty # The author of the book
10-
copyright : "2022" # Copyright year to be placed in the footer
10+
copyright : "2026" # Copyright year to be placed in the footer
1111
#logo : images/NeuroImage.png # A path to the book logo
1212
only_build_toc_files : true
1313

@@ -17,7 +17,7 @@ only_build_toc_files : true
1717
execute:
1818
execute_notebooks : force # Whether to execute notebooks at build time. Must be one of ("auto", "force", "cache", "off")
1919
cache : "" # A path to the jupyter cache that will be used to store execution artifacts. Defaults to `_build/.jupyter_cache/`
20-
exclude_patterns : "" # A list of patterns to *skip* in execution (e.g. a notebook that takes a really long time)
20+
exclude_patterns : [] # A list of patterns to *skip* in execution (e.g. a notebook that takes a really long time)
2121
timeout : 500 # The maximum time (in seconds) each notebook cell is allowed to run.
2222
run_in_temp : false # If `True`, then a temporary directory will be created and used as the command working directory (cwd),
2323
# otherwise the notebook's parent directory will be the cwd.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
numpy
22
scipy
33
matplotlib
4-
jupyter-book
4+
jupyter-book<2.0
55
ipywidgets

0 commit comments

Comments
 (0)