/ .github / workflows / deploy.yml
deploy.yml
 1  name: Deploy
 2  
 3  on:
 4    push:
 5      branches: [main]
 6  
 7  concurrency:
 8    group: deploy-${{ github.ref }}
 9    cancel-in-progress: true
10  
11  jobs:
12    lint:
13      name: Lint
14      runs-on: ubuntu-latest
15      steps:
16        - uses: actions/checkout@v4
17        - uses: actions/setup-node@v4
18          with:
19            node-version: 20
20            cache: npm
21        - run: npm ci
22        - run: npm run lint
23  
24    typecheck:
25      name: Type Check
26      runs-on: ubuntu-latest
27      steps:
28        - uses: actions/checkout@v4
29        - uses: actions/setup-node@v4
30          with:
31            node-version: 20
32            cache: npm
33        - run: npm ci
34        - run: npx tsc --noEmit
35  
36    test:
37      name: Test
38      runs-on: ubuntu-latest
39      steps:
40        - uses: actions/checkout@v4
41        - uses: actions/setup-node@v4
42          with:
43            node-version: 20
44            cache: npm
45        - run: npm ci
46        - run: npm run test
47  
48    build:
49      name: Build
50      runs-on: ubuntu-latest
51      env:
52        ANTHROPIC_API_KEY: dummy_key_for_build
53        NEXT_PUBLIC_SUPABASE_URL: https://placeholder.supabase.co
54        NEXT_PUBLIC_SUPABASE_ANON_KEY: placeholder_anon_key
55      steps:
56        - uses: actions/checkout@v4
57        - uses: actions/setup-node@v4
58          with:
59            node-version: 20
60            cache: npm
61        - uses: actions/cache@v4
62          with:
63            path: .next/cache
64            key: nextjs-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('**/*.ts', '**/*.tsx') }}
65            restore-keys: |
66              nextjs-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-
67        - run: npm ci
68        - run: npm run build