-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (58 loc) · 2.14 KB
/
build_deploy_pdoc.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
69
70
71
72
name: API docs / pdoc3
# We should trigger this from an upload event
on:
push:
branches: [master, dev]
workflow_run:
workflows: ["Conda Deployment"]
branches: [master]
types:
- completed
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: |
~/conda_pkgs_dir
~/.cache/pip
key: ubu-pdoc-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_api_docs_environment.yml') }}
- name: Miniconda + Cache
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
environment-file: .github/workflows/resources/conda_api_docs_environment.yml
activate-environment: conda-build-docs
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install quagmire
shell: bash -l {0}
run: |
VERSION=`python setup.py --version`
# install latest quagmire via conda, then over-ride with this source code
pip install -e .
- name: Build docs with pdoc
shell: bash -l {0}
run: |
VERSION=`python setup.py --version`
echo "VERSION=$(echo $VERSION)" >> $GITHUB_ENV
mkdir -p docs
cd docs
pdoc --config latex_math=True --html -o api --force quagmire
# Here we can add an action to build the jupyter book to a different directory
# and then they can be uploaded together. The jupyter book can contain a link to the
# API docs.
# Note deploy key needs the ----BEGIN ... KEY---- lines too
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.GH_PAGES_DEPLOY_PR_KEY }}
destination_dir: ${{ env.VERSION }}_api
publish_dir: docs/api/quagmire