-
Notifications
You must be signed in to change notification settings - Fork 192
46 lines (38 loc) · 1.2 KB
/
publish_book.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Publish book
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Setup environment
run: pip install --upgrade jupyter-book jupytext beautifulsoup4
- name: Cache jupyter-cache folder
uses: actions/cache@v2
env:
cache-name: jupyter-cache
with:
path: jupyter-book/_build/.jupyter_cache
key: v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
restore-keys: |
v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
v1-${{ github.ref }}
v1-refs/heads/master
- name: Build the JupyterBook
run: make
- name: Create CNAME record
run: |
cd ./jupyter-book/_build/html/
echo "www.sc-best-practices.org" > CNAME
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./jupyter-book/_build/html/