Restructure project: uv packaging, ruff+ty, MkDocs Material docs, new… #1
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: Docs | |
| # Build the MkDocs Material site and deploy it to GitHub Pages. | |
| # Pages source must be set to "GitHub Actions" in repo Settings → Pages. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - "mkdocs.yml" | |
| - "pyproject.toml" | |
| - "examples/**" | |
| - "CHANGELOG.md" | |
| - ".github/workflows/docs.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment; don't cancel an in-progress one. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Cairo/Pango (social cards) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev \ | |
| libjpeg-dev libpng-dev libz-dev pngquant | |
| - name: Build with MkDocs | |
| # The `docs` dependency group from pyproject.toml is the single source | |
| # of truth; CI=true (set by Actions) enables the social cards plugin. | |
| run: uv run --only-group docs mkdocs build --strict | |
| - uses: actions/configure-pages@v5 | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |