forked from PhotonVision/photonvision
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (65 loc) · 1.92 KB
/
photonvision-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
74
75
76
77
78
79
name: PhotonVision Sphinx Documentation Checks
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
merge_group:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
changed:
runs-on: ubuntu-22.04
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
docs: ${{ steps.filter.outputs.docs == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}
code: ${{ steps.filter.outputs.code == 'true' || steps.filter.outputs.workflow == 'true' || github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- name: Check for file changes
uses: dorny/paths-filter@v2
id: filter
with:
list-files: 'shell'
filters: |
docs:
- 'docs/**'
workflow:
- '.github/**'
code:
- 'photon-*/**'
build:
name: "Build Sphinx docs in Actions"
runs-on: ubuntu-22.04
needs: changed
if: needs.changed.outputs.docs== 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install and upgrade pip
run: python -m pip install --upgrade pip
- name: Install graphviz
run: |
sudo apt-get update
sudo apt-get -y install graphviz
- name: Install Python dependencies
working-directory: docs
run: |
pip install sphinx sphinx_rtd_theme sphinx-tabs sphinxext-opengraph doc8
pip install -r requirements.txt
- name: Check links
working-directory: docs
run: make linkcheck
continue-on-error: true
- name: Check lint
working-directory: docs
run: make lint
- name: Compile HTML
working-directory: docs
run: make html