ci: add GitHub Actions workflow for auto-updating API docs on code changes

- scripts/gen_api_docs.py: generates API HTML with source code + GitHub links
- .github/workflows/update-api-docs.yml: triggers on funasr/**/*.py changes
- Auto-deploys to gh-pages branch
This commit is contained in:
游雁
2026-05-21 11:31:42 +00:00
parent 77c72ee475
commit abffaa59f6
2 changed files with 337 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
name: Update API Documentation
on:
push:
branches: [main]
paths:
- 'funasr/**/*.py'
jobs:
build-api-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Generate API docs
run: python3 scripts/gen_api_docs.py
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages-output
publish_branch: gh-pages
keep_files: true