name: mkdocs

on:
  push:
    branches: [ master ]

jobs:
  docs:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - uses: astral-sh/setup-uv@v7
        with:
          enable-cache: true

      - name: Install dependencies
        run: uv sync --upgrade --group doc --all-extras

      - name: Build docs
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "GitHub Action"
          git fetch origin gh-pages:gh-pages
          uv run mike deploy v4.x
          git push origin gh-pages
