File tree Expand file tree Collapse file tree 2 files changed +39
-31
lines changed Expand file tree Collapse file tree 2 files changed +39
-31
lines changed Original file line number Diff line number Diff line change
1
+ name : Build Book
2
+
3
+ # Run this on pull requests
4
+ on :
5
+ pull_request :
6
+ branches :
7
+ - main
8
+
9
+ jobs :
10
+ build-book :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+
15
+ # Install dependencies
16
+ - name : Set up Python 3.11
17
+ uses : actions/setup-python@v4
18
+ with :
19
+ python-version : 3.11
20
+
21
+ - name : Install dependencies
22
+ run : |
23
+ pip install -r requirements.txt
24
+
25
+ # (optional) Cache your executed notebooks between runs
26
+ - name : Cache executed notebooks
27
+ uses : actions/cache@v3
28
+ with :
29
+ path : _build/.jupyter_cache
30
+ key : jupyter-book-cache-${{ hashFiles('requirements.txt') }}
31
+
32
+ # Build the book
33
+ - name : Build the book
34
+ run : |
35
+ jupyter-book build .
Original file line number Diff line number Diff line change 1
- name : deploy-book
1
+ name : Deploy Book
2
2
3
- # Run this on push to main branches and on pull requests
3
+ # Run this on push to main branch
4
4
on :
5
5
push :
6
6
branches :
7
7
- main
8
- pull_request :
9
- branches :
10
- - main
11
8
12
- # This job installs dependencies, builds the book, and pushes it to `gh-pages`
13
9
jobs :
14
- build -book :
10
+ deploy -book :
15
11
runs-on : ubuntu-latest
16
12
permissions :
17
13
pages : write
30
26
pip install -r requirements.txt
31
27
32
28
# (optional) Cache your executed notebooks between runs
33
- # if you have config:
34
- # execute:
35
- # execute_notebooks: cache
36
29
- name : Cache executed notebooks
37
30
uses : actions/cache@v3
38
31
with :
@@ -46,31 +39,11 @@ jobs:
46
39
47
40
# Upload the book's HTML as an artifact
48
41
- name : Upload artifact
49
- uses : actions/upload-artifact@v3
50
- with :
51
- name : jupyter-book-html
52
- path : " _build/html"
53
-
54
- deploy-book :
55
- needs : build-book
56
- runs-on : ubuntu-latest
57
- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
58
- permissions :
59
- pages : write
60
- id-token : write
61
- steps :
62
- - uses : actions/checkout@v3
63
-
64
- # Download the built book artifact
65
- - name : Download artifact
66
- uses : actions/download-artifact@v3
42
+ uses : actions/upload-pages-artifact@v2
67
43
with :
68
- name : jupyter-book-html
69
44
path : " _build/html"
70
45
71
46
# Deploy the book's HTML to GitHub Pages
72
47
- name : Deploy to GitHub Pages
73
48
id : deployment
74
49
uses : actions/deploy-pages@v2
75
- with :
76
- path : " _build/html"
You can’t perform that action at this time.
0 commit comments