Skip to content

Commit c66d97f

Browse files
authored
Fix docs CI (#51)
1 parent 4e1d43f commit c66d97f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/build-docs.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- dev
7+
pull_request:
8+
branches:
9+
- dev
710
workflow_dispatch:
811

912
concurrency:
@@ -37,6 +40,10 @@ jobs:
3740
run: |
3841
poetry install --with docs
3942
43+
- name: Test documentation
44+
run: |
45+
make test-docs
46+
4047
- name: build documentation
4148
run: |
4249
make docs
@@ -49,15 +56,16 @@ jobs:
4956
BRANCH_NAME=${BRANCH_NAME////_}
5057
echo BRANCH_NAME=${BRANCH_NAME} >> $GITHUB_ENV
5158
52-
- name: save artifact
59+
- name: Upload artifact
5360
uses: actions/upload-artifact@v4
5461
with:
5562
name: ${{ format('github-pages-for-branch-{0}', env.BRANCH_NAME) }}
5663
path: docs/build/
5764
retention-days: 3
5865

59-
- name: deploy website
66+
- name: Deploy to GitHub Pages
6067
uses: JamesIves/[email protected]
68+
if: ${{ github.ref == 'refs/heads/dev' }}
6169
with:
6270
branch: gh-pages
6371
folder: docs/build/html/

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ sync:
2929
.PHONY: docs
3030
docs:
3131
$(poetry) sphinx-apidoc -e -E -f --remove-old -o docs/source/apiref autointent
32+
$(poetry) python -m sphinx build -b html docs/source docs/build/html
33+
34+
.PHONY: test-docs
35+
test-docs: docs
3236
$(poetry) python -m sphinx build -b doctest docs/source docs/build/html
3337

3438
.PHONY: serve-docs

0 commit comments

Comments
 (0)