Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
e072ef3
1
Parent(s):
d369a9b
Create documentation deployment workflow
Browse files- .github/workflows/docs.yml +43 -0
.github/workflows/docs.yml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: docs
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
branches:
|
6 |
+
- 'master'
|
7 |
+
paths:
|
8 |
+
- 'pysr/**'
|
9 |
+
- '.github/workflows/docs.yml'
|
10 |
+
- 'docs/**'
|
11 |
+
- 'setup.py'
|
12 |
+
|
13 |
+
jobs:
|
14 |
+
test:
|
15 |
+
runs-on: ${{ matrix.os }}
|
16 |
+
defaults:
|
17 |
+
run:
|
18 |
+
shell: bash
|
19 |
+
|
20 |
+
steps:
|
21 |
+
- uses: actions/checkout@v2
|
22 |
+
- name: "Set up Python"
|
23 |
+
uses: actions/setup-python@v1
|
24 |
+
with:
|
25 |
+
python-version: 3.9.10
|
26 |
+
- name: "Install pydoc-markdown"
|
27 |
+
run: pip install pydoc-markdown
|
28 |
+
- name: "Set up npm"
|
29 |
+
uses: actions/setup-node@v2
|
30 |
+
with:
|
31 |
+
node-version: '14'
|
32 |
+
- name: "Install docsify"
|
33 |
+
run: npm install -g docsify
|
34 |
+
- name: "Build API docs"
|
35 |
+
run: |
|
36 |
+
pydoc-markdown --build --site-dir build -vv
|
37 |
+
cp docs/build/content/docs/api*.md docs/
|
38 |
+
for f in docs/api*.md; do mv "$f" "$f.bkup" && cat "$f.bkup" | sed '1,4d' > "$f" && rm "$f.bkup"; done
|
39 |
+
- name: "Deploy documentation"
|
40 |
+
uses: JamesIves/github-pages-deploy-action@v4.2.3
|
41 |
+
with:
|
42 |
+
branch: gh-pages
|
43 |
+
folder: docs
|