-
Notifications
You must be signed in to change notification settings - Fork 44
203 lines (146 loc) · 5.13 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Docs
on: [push, release]
jobs:
notebooks:
name: "Build the notebooks for the docs"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Checkout
uses: actions/checkout@v2
- name: Init Environment
#shell: bash -l {0}
run: |
brew update
brew install --cask basictex
eval "$(/usr/libexec/path_helper)"
- name: Setup base pkgs
#shell: bash -l {0}
run: |
python -m pip install --upgrade pip wheel
python -m pip install numpy numba tempita jupytext jupyterthemes jupyter_latex_envs papermill matplotlib astropy pandas tables healpy
python -m pip install ebltable black
- name: Install the package
#shell: bash -l {0}
run: |
python setup.py install
- name: Execute the notebooks
#shell: bash -l {0}
run: |
# Download an example file
wget https://www.astropy.org/astropy-data/photometry/spitzer_example_image.fits
mv spitzer_example_image.fits docs/md/
jupytext --to ipynb --execute docs/md/*.md
mv docs/md/*.ipynb docs/notebooks/
ls docs/notebooks
env:
OMP_NUM_THREADS: 1
MKL_NUM_THREADS: 1
NUMEXPR_NUM_THREADS: 1
MPLBACKEND: "Agg"
- name: Create function gallery
#shell: bash -l {0}
run: |
# move to the scripts directory
cd scripts
# now generate the function docs
python generate_func_docs.py
cd ..
ls docs/notebooks
- uses: actions/upload-artifact@v2
with:
name: notebooks-for-${{ github.sha }}
path: docs/notebooks
- name: Sleep for 5 min
uses: juliangruber/sleep-action@v1
with:
time: 5m
- name: Trigger RTDs build
uses: dfm/rtds-action@main
with:
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
commit_ref: ${{ github.ref }}
api_doc:
name: "Create the API stubs"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build the API doc
run: |
brew install c-blosc
brew install hdf5
pip3 install tempita
pip3 install cython
pip3 install numpy scipy numba astropy
python setup.py develop
brew install sphinx-doc pandoc
pip3 install wheel
pip3 install mock recommonmark
pip3 install sphinx-rtd-dark-mode
pip3 install -U sphinx
sphinx-apidoc -f -o docs/api/ astromodels
- uses: actions/upload-artifact@v2
with:
name: api-stubs-for-${{ github.sha }}
path: docs/api
build_docs:
name: "Build the Documentation"
runs-on: macos-latest
needs: [notebooks, api_doc]
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install package
run: |
brew install c-blosc
brew install hdf5
pip3 install tempita
pip3 install numpy scipy numba astropy
brew install sphinx-doc pandoc
pip3 install wheel
pip3 install mock recommonmark
pip3 install sphinx-rtd-dark-mode sphinx-math-dollar
pip3 install -r docs/requirements.txt
python3 setup.py develop
rm -rf docs/md/*
- uses: actions/download-artifact@master
with:
name: notebooks-for-${{ github.sha }}
path: docs/notebooks
- uses: actions/download-artifact@master
with:
name: api-stubs-for-${{ github.sha }}
path: docs/notebooks/api
- name: Build and Commit
uses: sphinx-notes/pages@v2
with:
documentation_path: docs
sphinx_version: 5.1.1
requirements_path: docs/requirements.txt
- name: Push changes
if: github.event_name == 'push' #&& startsWith(github.event.ref, 'refs/tags')
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages