Skip to content

Commit 8143779

Browse files
docs: Support deploying Sphinx docs to GitHub Pages(no gh-pages branch)
Signed-off-by: Bernhard Kaindl <[email protected]>
1 parent 992b1cf commit 8143779

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Based on the GitHub example deployment workflow for static pages
2+
name: Build and Deploy Static HTML Docs to GitHub Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["master"]
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
19+
# in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production
21+
# deployments to complete.
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: false
25+
26+
jobs:
27+
docs-to-gh-pages:
28+
environment:
29+
name: github-pages
30+
url: ${{ steps.deployment.outputs.page_url }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Set up Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.12'
40+
41+
- name: Install dependencies
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install -r docs/requirements.txt
45+
46+
- name: Build Sphinx documentation
47+
run: |
48+
make -C docs html
49+
- uses: actions/configure-pages@v5
50+
- uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: docs/build/html
53+
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)