-
Notifications
You must be signed in to change notification settings - Fork 152
61 lines (52 loc) · 1.56 KB
/
build_docs.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
name: "Build and deploy docs"
on:
push:
branches:
- main
release:
types: [ published ]
jobs:
docs:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: false
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Cache dependency
id: cache-dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Install sbi and dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[doc]
- name: strip output except plots and prints from tutorial notebooks
run: |
python tests/strip_notebook_outputs.py tutorials/
- name: convert notebooks to markdown
run: |
cd docs
jupyter nbconvert --to markdown ../tutorials/*.ipynb --output-dir docs/tutorials/
- name: Configure Git user for bot
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Build and deploy dev documentation upon push to main
if: ${{ github.event_name == 'push' }}
run: |
cd docs
mike deploy dev --push
- name: Build and deploy the lastest documentation upon new release
if: ${{ github.event_name == 'release' }}
run: |
cd docs
mike deploy ${{ github.event.release.name }} latest -u --push