Add MkDocs deployment workflow with README sync #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy MkDocs to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - 'README.md' | |
| - '.github/workflows/deploy-docs.yml' | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Install dependencies | |
| run: | | |
| uv venv | |
| source .venv/bin/activate | |
| uv pip install -e . | |
| - name: Install Cairo dependencies (for social cards) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libcairo2-dev libpango1.0-dev | |
| - name: Sync README to docs | |
| run: | | |
| source .venv/bin/activate | |
| python scripts/sync_readme_to_docs.py | |
| - name: Build and deploy docs | |
| run: | | |
| source .venv/bin/activate | |
| uv run mkdocs gh-deploy --force --clean --verbose |