This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.72 KB
/
CI.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
name: Build Jupyter Book Website
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
PYTHON_VERSION: "3.9"
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Restore Python virtualenv
uses: syphar/restore-virtualenv@v1
id: cache-virtualenv
- name: Download Pip cache
uses: syphar/restore-pip-download-cache@v1
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
- name: Install Python dependencies if cache miss
run: pip install -r requirements.txt
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
- name: Cache Jupyter book outputs
uses: actions/cache@v3
env:
cache-name: "jb"
with:
path: docs/_build/
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('docs/**/*.md', 'docs/**/*.ipynb') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
- name: Build Jupyter Books
run: jb build docs --warningiserror --keep-going -v
- name: Deploy Website
uses: peaceiris/[email protected]
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true
publish_dir: docs/_build/html
full_commit_message: ${{ github.event.head_commit.message }}