name: Deploy docs
on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:
    # Allows manual triggering from the GitHub Actions UI
    
permissions:
  contents: write
jobs:
  deploy:
    concurrency: ci-${{ github.ref }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v3

      - name: Install uv
        uses: astral-sh/setup-uv@v5
        with:
          python-version: '3.13'
          enable-cache: true
          cache-dependency-glob: "uv.lock"

      - name: Install the project
        run: uv sync --locked --all-extras --dev

      - name: Build docs 📚
        run: |
          cd docs
          uv run make html

      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: docs/_build/html
          branch: docs
