Skip to content

Commit 2873bb9

Browse files
committed
doc: Added a github workflow which automatically builds and deploys the documentation to the github pages webserver
from now on, any change to the 'site' branch will trigger a rebuild/deploy action.
1 parent 4bd1b0e commit 2873bb9

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Workflow for building and deploying a Sphinx site to GitHub Pages
2+
name: Build and deploy sphinx docs to GitHub Pages from site branch
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["deployed-website"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v4
33+
- name: Sphinx Build
34+
uses: ammaraskar/sphinx-action@7.1.2
35+
with:
36+
docs-folder: doc/src
37+
build-command: make html
38+
# Run before the build command, you can use this to install system level dependencies, for example with "apt-get update -y && apt-get install -y perl"
39+
pre-build-command: doc/src/tools/setup-build-process.sh
40+
- name: Upload github pages artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: "doc/src/_build/html/"
44+
45+
# Deployment job
46+
deploy:
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
runs-on: ubuntu-latest
51+
needs: build
52+
steps:
53+
- name: Deploy uploaded artifact to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

doc/src/tools/setup-build-process.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
export DEBIAN_FRONTEND=noninteractive
4+
apt-get update -yy
5+
apt-get upgrade -yy
6+
apt-get install -yy git
7+
git config --global --add safe.directory /github/workspace
8+
pip3 install sphinx-immaterial doxysphinx

0 commit comments

Comments
 (0)