Skip to content

Commit 986d864

Browse files
Create deploy-book.yml
1 parent edbdcd3 commit 986d864

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/deploy-book.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy Book
2+
3+
# Run this on push to main branch
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
deploy-book:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pages: write
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
# Install dependencies
19+
- name: Set up Python 3.11
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: 3.11
23+
24+
- name: Install dependencies
25+
run: |
26+
pip install -r requirements.txt
27+
28+
# (optional) Cache your executed notebooks between runs
29+
- name: Cache executed notebooks
30+
uses: actions/cache@v3
31+
with:
32+
path: _build/.jupyter_cache
33+
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}
34+
35+
# Build the book
36+
- name: Build the book
37+
run: |
38+
jupyter-book build .
39+
40+
# Upload the book's HTML as an artifact
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v2
43+
with:
44+
path: "_build/html"
45+
46+
# Deploy the book's HTML to GitHub Pages
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)