-
Notifications
You must be signed in to change notification settings - Fork 13
68 lines (59 loc) · 1.6 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: build-and-deploy
# Only run this when the master branch changes
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/cache@v3
with:
path: /var/lib/apt
key: apt-cache-v2
restore-keys: |
apt-cache-v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
curl \
bzip2 \
ca-certificates \
dvipng
- uses: actions/checkout@v3
# Install dependencies
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Pip dependencies
run: |
pip install "pip==23.0.1"
pip install -r build_requirements.txt
# Build the page
- name: Build the book
run: |
make html
- uses: actions/upload-artifact@v3
if: failure()
with:
name: error_logs
path: ./_build/html/reports
# Push the book's HTML to github-pages
- name: GitHub Pages action
if: ${{ github.ref == 'refs/heads/main' }}
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html