-
Notifications
You must be signed in to change notification settings - Fork 13
41 lines (33 loc) · 1.08 KB
/
publish_book.yaml
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
name: Publish JupyterBook to GitHub Pages
on:
push:
pull_request:
types: [ opened, reopened ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Python dependencies
run: |
sudo apt-get install python3-pip
pip install git+git://github.com/executablebookproject/cli.git#egg=master
pip install ghp-import
PATH="${PATH}:${HOME}/.local/bin"
- name: Build book TOC file
run: |
jupyter-book toc ./notebooks
- name: Build book HTML
run: |
jupyter-book build ./content
- name: Push _build/html to gh-pages
run: |
sudo chown -R $(whoami):$(whoami) .
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
git remote set-url origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
ghp-import ./content/_build/html -f -p -n