-
Notifications
You must be signed in to change notification settings - Fork 17
49 lines (44 loc) · 1.34 KB
/
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
name: pdoc
defaults:
run:
shell: bash
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'
jobs:
pdoc:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
persist-credentials: false
- uses: actions/setup-python@v5.2.0
with:
python-version: 3.9
- env:
JUPYTER_PLATFORM_DIRS: 1
run: |
pip3 install pdoc nbformat
pip install -e . -e ./examples
python - <<EOF
import glob, nbformat
for notebook_path in glob.glob('examples/PyMPDATA_examples/*/*.ipynb'):
with open(notebook_path, encoding="utf8") as fin:
with open(notebook_path + ".badges.md", 'w') as fout:
fout.write(nbformat.read(fin, nbformat.NO_CONVERT).cells[0].source)
EOF
PDOC_ALLOW_EXEC=1 python -We -m pdoc -o html PyMPDATA examples/PyMPDATA_examples -t docs/templates --math
- if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }}
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: pdoc
folder: html
clean: true