-
Notifications
You must be signed in to change notification settings - Fork 2
162 lines (114 loc) · 4.33 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
name: Docs
on: [push, release]
jobs:
notebooks:
name: "Build the notebooks for the docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install black
pip install --upgrade numpy ipython jupyter cython astropy numpy numba
pip install jupytext jupyterthemes
pip3 install git+https://github.com/threeML/astromodels.git@dev#egg=astromodels
#pip3 install git+https://github.com/threeML/threeML.git@dev#egg=threeML
python setup.py develop
- name: Execute the notebooks
shell: bash -l {0}
run: |
# generate the yml file
cp scripts/generate_yaml.py docs/md/
cd docs/md/
python generate_yaml.py
ls
cd ../../
jupytext --to ipynb --pipe black --execute docs/md/*.md
mv docs/md/*.ipynb docs/notebooks
- uses: actions/upload-artifact@v2
with:
name: notebooks-for-${{ github.sha }}
path: docs/notebooks
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.8
- name: Build the API doc
run: |
brew install c-blosc
brew install hdf5
pip3 install cython
pip3 install numpy scipy numba astropy
pip3 install git+https://github.com/threeML/astromodels.git@dev#egg=astromodels
#pip3 install git+https://github.com/threeML/threeML.git@dev#egg=threeML
python setup.py develop
brew install sphinx-doc pandoc
pip3 install wheel
pip3 install mock recommonmark
pip3 install sphinx-rtd-dark-mode
pip3 install nbsphinx sphinx-gallery
sphinx-apidoc -f -o docs/api/ ronswanson ronswanson/data
- 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.8
- name: Install package
run: |
brew install c-blosc
brew install hdf5
pip3 install numpy scipy numba astropy
pip3 install git+https://github.com/threeML/astromodels.git@dev#egg=astromodels
#pip3 install git+https://github.com/threeML/threeML.git@dev#egg=threeML
brew install sphinx-doc pandoc
pip3 install wheel
pip3 install mock recommonmark
pip3 install sphinx==5.1.1 sphinx-rtd-dark-mode
pip3 install nbsphinx sphinx-gallery
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