name: Deploy Documentation

on:
    push:
        branches:
            - main
            - master
    workflow_dispatch:

permissions:
    contents: write

jobs:
    deploy:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v4

            - name: Install uv
              uses: astral-sh/setup-uv@v5
              with:
                  enable-cache: true
                  python-version: "3.11"

            - name: Sync Example Notebooks to Docs
              run: uv run python scripts/sync_docs_examples.py

            - name: Install dependencies
              run: uv pip install .[docs]

            - name: Deploy to GitHub Pages
              run: uv run mkdocs gh-deploy --force
