name: Web Apps CI

on:
  push:
    paths:
      - 'apps/web-*/**'
      - 'packages/**'
  pull_request:
    paths:
      - 'apps/web-*/**'
      - 'packages/**'

jobs:
  lint-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup PNPM
        uses: pnpm/action-setup@v2
        with:
          version: 8
      
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'pnpm'
      
      - name: Install dependencies
        run: pnpm install --frozen-lockfile
      
      - name: Lint Web Admin
        run: pnpm --filter @goodgo/web-admin lint || echo "Skipped"
      
      - name: Lint Web Client
        run: pnpm --filter @goodgo/web-client lint || echo "Skipped"
      
      - name: Type check Web Admin
        run: pnpm --filter @goodgo/web-admin typecheck || echo "Skipped"
      
      - name: Type check Web Client
        run: pnpm --filter @goodgo/web-client typecheck || echo "Skipped"
      
      - name: Build Web Admin
        run: pnpm --filter @goodgo/web-admin build || echo "Skipped"
      
      - name: Build Web Client
        run: pnpm --filter @goodgo/web-client build || echo "Skipped"
