-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 1.95 KB
/
docs.yml
File metadata and controls
74 lines (66 loc) · 1.95 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
env:
VERSION: ${{ inputs.version }}
jobs:
docs:
name: Build documentation
runs-on: 'ubuntu-20.04'
steps:
- run: sudo apt install --yes graphviz pandoc
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }}
fetch-depth: 0 # history required so cmake can determine version
- uses: actions/setup-python@v3
with:
python-version: '3.10'
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
- run: |
tox --skip-pkg-install -e docs -- thermoblock==${VERSION}
echo "target=$(python docs/version.py --version=${VERSION} --action=get-target)" >> $GITHUB_ENV
if: ${{ inputs.publish }}
- run: tox -e docs
if: ${{ !inputs.publish }}
- uses: actions/upload-artifact@v3
with:
name: html
path: html/
- uses: JamesIves/github-pages-deploy-action@v4.7.6
if: ${{ inputs.publish }}
with:
branch: gh-pages
folder: html
target-folder: ${{ env.target }}
single-commit: true
clean-exclude: release
ssh-key: ${{ secrets.GH_PAGES_DEPLOY_KEY }}