Skip to content

Commit 5c93329

Browse files
authored
Add GitHub Actions workflow for documentation build closes #12
This workflow builds the documentation on pushes to the main branch and deploys it to GitHub Pages.
1 parent af4b7eb commit 5c93329

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/docs.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Documentation
2+
3+
# build the documentation whenever there are new commits on main
4+
on:
5+
push:
6+
branches:
7+
- main
8+
# Alternative: only build for tags.
9+
# tags:
10+
# - '*'
11+
12+
# security: restrict permissions for CI jobs.
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
# Build the documentation and upload the static HTML files as an artifact.
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
# setup
22+
- uses: actions/checkout@v5
23+
with:
24+
persist-credentials: false
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.13'
29+
30+
- uses: astral-sh/setup-uv@v6
31+
with:
32+
enable-cache: true
33+
34+
- name: Install chordnet dependencies
35+
run: uv sync --frozen --all-extras --dev
36+
37+
- name: Build docs
38+
run: pdoc -o docs/ chordnet
39+
40+
- uses: actions/upload-pages-artifact@v4
41+
with:
42+
path: docs/
43+
44+
# Deploy the artifact to GitHub pages.
45+
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
46+
deploy:
47+
needs: build
48+
runs-on: ubuntu-latest
49+
permissions:
50+
pages: write
51+
id-token: write
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- id: deployment
57+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)