Skip to content

Commit 939c8d9

Browse files
committed
Add github workflow to automate build
1 parent dcba36b commit 939c8d9

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: deploy-book
2+
3+
# Run this when the master or main branch changes
4+
on:
5+
push:
6+
branches:
7+
- master
8+
9+
# This job installs dependencies, builds the book, and pushes it to `gh-pages`
10+
jobs:
11+
deploy-book:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
pages: write
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v5
18+
19+
# Install dependencies
20+
- name: Set up Python
21+
uses: actions/setup-python@v6
22+
with:
23+
python-version: "3.13"
24+
cache: pip # Implicitly uses requirements.txt for cache key
25+
26+
- name: Install dependencies
27+
run: pip install -r requirements.txt
28+
29+
# (optional) Cache your executed notebooks between runs
30+
# if you have config:
31+
# execute:
32+
# execute_notebooks: cache
33+
# - name: cache executed notebooks
34+
# uses: actions/cache@v4
35+
# with:
36+
# path: _build/.jupyter_cache
37+
# key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}
38+
39+
# Build the book
40+
- name: Build the book
41+
run: |
42+
jupyter-book build --all .
43+
44+
# 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
45+
46+
# Upload the book's HTML as an artifact
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v4
49+
with:
50+
path: _build/html
51+
52+
# Deploy the book's HTML to GitHub Pages
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jupyter-book

0 commit comments

Comments
 (0)