-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (51 loc) · 1.47 KB
/
publish-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
---
# used for publishing documentation on push to main or published release
name: publish docs
on:
push:
branches:
- main
release:
types:
- published
jobs:
build:
# only build and deploy docs if the actor is not dependabot
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --all --tags
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup for poetry
run: |
python -m pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
- name: poetry deps
run: poetry install
- name: Build documentation
run: |
mkdir pages
touch pages/.nojekyll
cd docs
poetry run sphinx-multiversion src build
# remove any doctrees dirs which aren't needed for publishing
find ./build -type d -name '.doctrees' -exec rm -rf {} +
cp -r build/* ../pages/
- name: Add index redirector to latest docs
run: |
cp docs/redirector.html pages/index.html
- name: Add media folder to latest docs
run: |
cp -r docs/src/media pages/media
- name: Deploy documentation
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: pages
folder: pages