Skip to content

Commit a986a4e

Browse files
committed
feat: add GitHub Actions workflow for automatic API documentation updates
Signed-off-by: James Ding <[email protected]>
1 parent 99b1d40 commit a986a4e

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/docs.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Update Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-docs:
10+
name: Generate and Update API Docs
11+
runs-on: ubuntu-latest
12+
environment: docs
13+
steps:
14+
- name: Checkout fish-audio-python
15+
uses: actions/checkout@v4
16+
with:
17+
path: sdk
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v4
21+
22+
- name: Install dependencies
23+
working-directory: sdk
24+
run: uv sync
25+
26+
- name: Generate API documentation
27+
working-directory: sdk
28+
run: uv run pydoc-markdown
29+
30+
- name: Checkout docs
31+
uses: actions/checkout@v4
32+
with:
33+
repository: ${{ vars.DOCS_REPO }}
34+
path: docs
35+
36+
- name: Create module reference directory
37+
run: mkdir -p docs/sdk-reference/python/module-reference
38+
39+
- name: Copy generated documentation
40+
run: |
41+
cp sdk/build/docs/content/fishaudio/*.md docs/sdk-reference/python/module-reference/
42+
cp sdk/build/docs/content/fish_audio_sdk.md docs/sdk-reference/python/module-reference/
43+
44+
- name: Create Pull Request
45+
uses: peter-evans/create-pull-request@v6
46+
with:
47+
token: ${{ secrets.DOCS_TOKEN }}
48+
path: docs
49+
commit-message: |
50+
chore: update Python SDK API reference
51+
52+
Auto-generated from fishaudio/fish-audio-python@${{ github.sha }}
53+
branch: auto/python-api-docs
54+
delete-branch: true
55+
sign-commits: true
56+
title: "Update Python SDK API Reference"
57+
body: |
58+
Auto-generated API documentation update from [fish-audio-python@${{ github.sha }}](https://github.com/fishaudio/fish-audio-python/commit/${{ github.sha }})
59+
60+
## Changes
61+
- Updated API reference documentation for Python SDK
62+
- Generated from latest docstrings in the codebase
63+
64+
labels: |
65+
python

0 commit comments

Comments
 (0)