-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (92 loc) · 2.53 KB
/
docs.yml
File metadata and controls
107 lines (92 loc) · 2.53 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Build and Deploy Docs
on:
pull_request:
paths:
- "docs/**"
- ".github/workflows/docs.yml"
- "**/*.h"
- "**/*.hpp"
- "**/*.hh"
- "**/*.c"
- "**/*.cc"
- "**/*.cpp"
- "**/*.cxx"
push:
branches: [main]
paths:
- "docs/**"
- ".github/workflows/docs.yml"
- "**/*.h"
- "**/*.hpp"
- "**/*.hh"
- "**/*.c"
- "**/*.cc"
- "**/*.cpp"
- "**/*.cxx"
workflow_dispatch:
inputs:
build_cpp_api:
description: "Regenerate the C++ API with Doxygen/Exhale"
required: false
default: "true"
type: choice
options:
- "true"
- "false"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build Sphinx docs
runs-on: ubuntu-latest
env:
# In GitHub Actions, use true by default because the runner is fresh.
# Locally, you can still skip this with BUILD_CPP_API=0.
BUILD_CPP_API: ${{ github.event_name == 'workflow_dispatch' && inputs.build_cpp_api || 'true' }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: docs/requirements.txt
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz
- name: Install Python docs dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt
- name: Build docs
run: |
sphinx-build -M html docs/source docs/build --keep-going
- name: Upload built HTML as workflow artifact
uses: actions/upload-artifact@v4
with:
name: ngps-docs-html
path: docs/build/html
- name: Upload GitHub Pages artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html
deploy:
name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy docs to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4