-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.28 KB
/
build-docs.yml
File metadata and controls
51 lines (43 loc) · 1.28 KB
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
name: Build Docs
on:
push:
branches: [ main, dev ]
tags: [ v* ]
jobs:
deploy-docs:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
fail-fast: false
steps:
- name: Checkout DesignerDNA Project
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.event.repository.default_branch }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version-default
- name: Install dependencies
run: |
python -m pip install -U pip
pip install wheel setuptools
pip install ".[doc]"
- name: Build documentation
run: |
sphinx-multiversion docs/source _build
- name: Add Redirect Page
# NOTE: when only one version is built, it is not within a separate directory
if: ${{ hashFiles('_build/index.html') == '' }}
run: |
cp docs/source/_templates/redirect.html _build/index.html
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build
publish_branch: gh-pages
force_orphan: true