-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (69 loc) · 2.04 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Docs
on:
workflow_dispatch:
inputs:
publish:
default: false
type: boolean
version:
default: ''
required: false
type: string
branch:
description: 'Branch/tag with documentation source. If not set, the current branch will be used.'
default: ''
required: false
type: string
workflow_call:
inputs:
publish:
default: false
type: boolean
version:
default: ''
required: false
type: string
branch:
description: 'Branch/tag with documentation source. If not set, the current branch will be used.'
default: ''
required: false
type: string
linkcheck:
description: 'Run the link checker. If not set the link checker will not be run.'
default: false
required: false
type: boolean
env:
VERSION: ${{ inputs.version }}
jobs:
docs:
name: Build documentation
runs-on: 'ubuntu-22.04'
steps:
- run: sudo apt install --yes graphviz pandoc
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 # history required so cmake can determine version
- uses: actions/setup-python@v5
with:
python-version-file: '.github/workflows/python-version-ci'
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
- run: tox -e releasedocs -- ${VERSION}
if: ${{ inputs.version != '' }}
- run: tox -e docs
if: ${{ inputs.version == '' }}
- run: tox -e linkcheck
if: ${{ inputs.linkcheck }}
- uses: actions/upload-artifact@v4
with:
name: docs_html
path: html/
- uses: JamesIves/[email protected]
if: ${{ inputs.publish }}
with:
branch: gh-pages
folder: html
single-commit: true