-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (75 loc) · 2.47 KB
/
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Docs
on: [push, pull_request, release]
jobs:
setup:
name: Setup docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install black jupytext
python -m pip install nbconvert ipykernel
python -m pip install sphinx nbsphinx
python -m pip install .
- name: Run notebooks
run: |
jupytext --to ipynb --pipe black --execute docs/markdown/public_data_access.md
jupytext --to ipynb --pipe black --execute docs/markdown/detector_model.md
jupytext --to ipynb --pipe black --execute docs/markdown/source_model.md
jupytext --to ipynb --pipe black --execute docs/markdown/simulation.md
jupytext --to ipynb --pipe black --execute docs/markdown/point_source_likelihood.md
jupytext --to ipynb --pipe black --execute docs/markdown/point_source_analysis.md
jupytext --to ipynb --pipe black --execute docs/markdown/events.md
mv docs/markdown/*.ipynb docs/notebooks
- uses: actions/upload-artifact@v4
with:
name: notebooks-for-${{ github.sha }}
path: docs/notebooks
- name: Generate API docs
run: |
sphinx-apidoc -f -e -o docs/api icecube_tools
- uses: actions/upload-artifact@v4
with:
name: api-for-${{ github.sha }}
path: docs/api
build:
name: Build docs
runs-on: ubuntu-latest
needs: setup
steps:
- name: Setup
run: sudo apt-get install -y pandoc
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
- uses: actions/download-artifact@v4
with:
name: notebooks-for-${{ github.sha }}
path: docs/notebooks
- uses: actions/download-artifact@v4
with:
name: api-for-${{ github.sha }}
path: docs/api
- name: Build and Commit
uses: sphinx-notes/pages@master
with:
documentation_path: docs
- name: Push changes
if: github.event_name == 'push' && github.ref_name == 'master'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages