Skip to content

πŸŽ› πŸ”Š A Python library for audio.

Auto-generate docs on a separate branch. (#422)

Peter Sobot56517021d3a1
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 0000000..d6eabb4
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,61 @@
+name: Deploy Documentation
+
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - 'v*' # Run on version tags
+ workflow_dispatch: # Allow manual triggering
+
+jobs:
+ build-and-deploy:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.10'
+ cache: 'pip'
+
+ - name: Install Linux dependencies
+ run: |
+ sudo apt-get update \
+ && sudo apt-get install -y pkg-config libsndfile1 \
+ libx11-dev libxrandr-dev libxinerama-dev \
+ libxrender-dev libxcomposite-dev libxcb-xinerama0-dev \
+ libxcursor-dev libfreetype6 libfreetype6-dev \
+ libasound2-dev
+
+ - name: Install Dependencies
+ env:
+ # Optimization settings to improve build speed
+ DISABLE_LTO: "1"
+ # Avoid NumPy build issues
+ NPY_BLAS_ORDER: ""
+ NPY_LAPACK_ORDER: ""
+ run: |
+ python -m pip install --upgrade pip
+ pip install build wheel
+ pip install -e .
+ pip install black mypy pybind11-stubgen sphinx psutil typing-extensions numpy
+
+ - name: Generate Documentation
+ run: |
+ python scripts/generate_type_stubs_and_docs.py
+
+ - name: Deploy to GitHub Pages
+ uses: peaceiris/actions-gh-pages@v4
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./docs
+ publish_branch: docs
+ force_orphan: true
+ full_commit_message: 'docs: update documentation for ${{ github.ref_name }}'
\ No newline at end of file