Skip to content

Commit 7fe1b6f

Browse files
committed
Add GitHub workflow to publish sphinx documentation
... and a .gitignore for locally generated sphinx documentation Sample display at https://databean.github.io/CodeHawk-C/
1 parent 73d9fb4 commit 7fe1b6f

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/sphinx_docs.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
document:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
- name: Install dependencies
24+
run: |
25+
sudo apt update && sudo apt upgrade && sudo apt install -y make python3-sphinx sphinx-rtd-theme-common python3-sphinx-rtd-theme
26+
- name: Generate documentation
27+
run: |
28+
cd docs/source && make html
29+
- name: Fix permissions
30+
run: |
31+
chmod -c -R +rX "CodeHawk/_build/default/_doc/_html" | while read line; do
32+
echo "::warning title=Invalid file permissions automatically fixed::$line"
33+
done
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v2
36+
with:
37+
path: ./docs/source/_build/html/
38+
39+
deploy_document:
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
runs-on: ubuntu-latest
44+
needs: document
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v2

docs/source/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_build

0 commit comments

Comments
 (0)