name: Test Build on Pull Request

on:
  pull_request:
    branches:
      - main

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

    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Set up Node.js
        uses: actions/setup-node@v6
        with:
          node-version: '24.x'

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: latest

      - name: Install dependencies
        run: bun install

      - name: Build the website
        run: bun run build
        env:
          SANITY_ID: ${{ secrets.SANITY_ID }}
