name: Site

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

permissions:
  contents: read

defaults:
  run:
    working-directory: site

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

    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
        with:
          persist-credentials: false
      - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
        with:
          node-version: 24
          cache: npm
          cache-dependency-path: site/package-lock.json
      - name: Install dependencies
        run: npm ci
      - name: Format
        run: npm run format:check
      - name: Lint
        run: npm run check
      - name: Test
        run: npm test --if-present
      - name: Build
        run: npm run build
