Skip to content

Commit 3cf02f6

Browse files
jacalataclaude
andcommitted
ci: add workflow to build Sphinx docs and PR to gh-pages
On push to master, builds Sphinx HTML and opens a PR from docs-update into gh-pages so the generated API reference can be reviewed before going live. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8cebc5e commit 3cf02f6

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and publish docs
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
build-and-pr:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.13"
20+
21+
- name: Install docs dependencies
22+
run: pip install -e ".[docs]"
23+
24+
- name: Build Sphinx docs
25+
run: sphinx-build -b html docs sphinx_build
26+
27+
- name: Checkout gh-pages
28+
uses: actions/checkout@v4
29+
with:
30+
ref: gh-pages
31+
path: gh-pages
32+
33+
- name: Copy Sphinx output into gh-pages/sphinx
34+
run: |
35+
rm -rf gh-pages/sphinx
36+
cp -r sphinx_build gh-pages/sphinx
37+
38+
- name: Create PR to gh-pages
39+
uses: peter-evans/create-pull-request@v6
40+
with:
41+
path: gh-pages
42+
branch: docs-update
43+
base: gh-pages
44+
title: "docs: update generated API reference"
45+
body: "Automated update of Sphinx-generated API reference from master."
46+
commit-message: "docs: regenerate Sphinx API reference"

0 commit comments

Comments
 (0)