Skip to content

Commit 431604c

Browse files
authored
ci: fix jupyter book build (#93)
* Update book CI * Update `gitignore` * Update `pyproject.toml` * Update Jupyter Book setup
1 parent ffb8f9a commit 431604c

7 files changed

Lines changed: 67 additions & 30 deletions

File tree

.github/workflows/book.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,45 @@ on:
55
branches:
66
- main
77

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
921
jobs:
10-
deploy-book:
22+
deploy:
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
1126
runs-on: ubuntu-latest
1227
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
1631
- name: Set up Python 3.14
1732
uses: actions/setup-python@v6
1833
with:
19-
python-version: "3.14"
20-
34+
python-version: "3.14"
2135
- name: Install dependencies
2236
run: |
23-
pip install jupyter-book
24-
37+
python -m pip install --upgrade pip
38+
pip install jupyter-book
2539
- name: Build the book
2640
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
3145
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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,5 @@ jobs/
164164
# pixi environments
165165
.pixi/*
166166
!.pixi/config.toml
167+
168+
notebooks/_build

notebooks/_config.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

notebooks/_static/custom.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* Hide "Made with MyST" branding in navbar */
2+
.myst-home-link {
3+
display: none !important;
4+
}
5+
6+
/* Hide "Made with MyST" branding in sidebar (if present) */
7+
.myst-made-with-myst {
8+
display: none !important;
9+
}

notebooks/_toc.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

notebooks/myst.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 1
2+
project:
3+
title: Single-cell analysis repository
4+
# To display author(s)
5+
# authors:
6+
# - name: Author One
7+
# email: author1@email.com
8+
# affiliation:
9+
# - Institute A
10+
# - name: Author Two
11+
# email: author2@email.com
12+
# To link to GitHub repo
13+
# github: GitHubID/REPO_NAME
14+
toc:
15+
- file: index.md
16+
- title: Template notebook
17+
children:
18+
- file: template.ipynb
19+
site:
20+
options:
21+
folders: true
22+
style: _static/custom.css
23+
template: book-theme

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ test = [
4141
"pytest",
4242
"pytest-cov",
4343
]
44+
docs = [ "jupyter-book>=1" ]
45+
agentic = [ "jcodemunch-mcp" ]
4446
jupyter = [
4547
"ipywidgets",
4648
"jupyterlab",

0 commit comments

Comments
 (0)