Skip to content

Commit 56d0d01

Browse files
authored
Merge pull request #194 from PolicyEngine/fix-jupyter-book-deployment
Fix Jupyter Book deployment to GitHub Pages
2 parents fd167c5 + 0cb9c60 commit 56d0d01

5 files changed

Lines changed: 91 additions & 36 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy Jupyter Book
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "docs/**"
9+
- ".github/workflows/docs.yaml"
10+
pull_request:
11+
paths:
12+
- "docs/**"
13+
- ".github/workflows/docs.yaml"
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
build-and-deploy:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.13"
30+
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v5
33+
34+
- name: Install Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: "22"
38+
39+
- name: Install Jupyter Book 2.0 and MyST
40+
run: |
41+
uv pip install --pre "jupyter-book==2.*" --system
42+
npm install -g mystmd
43+
44+
- name: Build book
45+
run: |
46+
cd docs
47+
rm -rf _build .jupyter_cache
48+
myst clean || true
49+
myst build --html
50+
touch _build/html/.nojekyll
51+
env:
52+
BASE_URL: /policyengine-uk-data
53+
54+
- name: Deploy to GitHub Pages
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
56+
uses: JamesIves/github-pages-deploy-action@v4
57+
with:
58+
branch: gh-pages
59+
folder: docs/_build/html
60+
clean: true

changelog_entry.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- bump: minor
2+
changes:
3+
changed:
4+
- Upgraded documentation to Jupyter Book 2.0 (MyST-based)
5+
fixed:
6+
- Jupyter Book deployment to GitHub Pages by adding docs workflow and fixing branch reference

docs/_config.yml

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

docs/_toc.yml

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

docs/myst.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 1
2+
project:
3+
title: PolicyEngine UK data
4+
authors:
5+
- name:
6+
given: PolicyEngine
7+
family: Team
8+
copyright: '2024'
9+
github: policyengine/policyengine-uk-data
10+
toc:
11+
- file: intro.md
12+
- file: methodology.ipynb
13+
- file: validation/index.md
14+
children:
15+
- file: validation/national.ipynb
16+
- file: validation/constituencies.ipynb
17+
- file: validation/local_authorities.ipynb
18+
- file: pension_contributions.ipynb
19+
- file: constituency_methodology.ipynb
20+
- file: LA_methodology.ipynb
21+
site:
22+
options:
23+
logo: logo.png
24+
folders: true
25+
template: book-theme

0 commit comments

Comments
 (0)