Skip to content

Commit 39eb19d

Browse files
authored
Add API doc publishing step (#38)
1 parent a8e842b commit 39eb19d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ jobs:
1414
matrix:
1515
python: ["3.7", "3.10"]
1616
os: [ubuntu-latest, macos-latest, windows-latest]
17+
include:
18+
- os: ubuntu-latest
19+
python: 3.10
20+
docsTarget: true
1721
runs-on: ${{ matrix.os }}
1822
steps:
1923
- name: Print build information
@@ -37,6 +41,27 @@ jobs:
3741
- run: poe build-develop
3842
- run: poe test -s -o log_cli_level=DEBUG
3943

44+
# Do docs stuff (only on one host)
45+
- name: Build API docs
46+
if: ${{ matrix.docsTarget }}
47+
run: poe gen-docs
48+
- name: Deploy prod API docs
49+
if: ${{ github.ref == 'refs/heads/main' && matrix.docsTarget }}
50+
uses: netlify/actions/cli@master
51+
with:
52+
args: deploy --dir=build/apidocs --prod
53+
env:
54+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
55+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
56+
- name: Deploy draft API docs
57+
if: ${{ github.ref != 'refs/heads/main' && matrix.docsTarget }}
58+
uses: netlify/actions/cli@master
59+
with:
60+
args: deploy --dir=build/apidocs
61+
env:
62+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
63+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
64+
4065
# Compile the binaries and upload artifacts
4166
compile-binaries:
4267
strategy:

0 commit comments

Comments
 (0)