name: Docs Check

on:
  pull_request:
    branches: [main, master]
    paths:
      - 'docs-site/**'
      - '.github/workflows/docs-check.yml'
      - '.github/workflows/docs-deploy.yml'
      - 'README.md'
      - 'package.json'

jobs:
  docs-build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Setup pnpm
        uses: pnpm/action-setup@v6

      - name: Setup Node.js
        uses: actions/setup-node@v5
        with:
          node-version: lts/*
          cache: pnpm
          cache-dependency-path: docs-site/pnpm-lock.yaml

      - name: Install docs dependencies
        working-directory: docs-site
        run: pnpm install --frozen-lockfile

      - name: Build docs
        working-directory: docs-site
        run: pnpm build
