name: Docs CI

on:
  pull_request:
    paths:
      - "docs/**"
      - ".github/workflows/docs-ci.yml"
  push:
    branches: [main]
    paths:
      - "docs/**"
      - ".github/workflows/docs-ci.yml"

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: npm

      - name: Install
        run: npm ci

      - name: Lint Markdown
        run: npx markdownlint-cli2 "docs/**/*.md"

      - name: Build Docs
        run: npm run build

