Files
loki/.github/workflows/ci.yml
T
g-butandClaude Opus 4.7 aa75af712f fix(ci): drop the build step — needs a live DB the workflow can't have
The first run of cca3113 failed because /events (and likely every other
DB-backed page) does its DB query during Next's static pre-render,
hitting the stub DATABASE_URL with ECONNREFUSED.

Two options to fix:
  A) Mark every DB-backed page `export const dynamic = "force-dynamic"`.
     Real fix, but it's a prod-behavior change (every request re-fetches
     instead of serving cached HTML).
  B) Drop `next build` from CI and rely on Vercel's deploy build —
     which has a real DB attached — to catch build issues.

Going with B. Pre-commit + CI now gate type/lint (cheap, fast,
DB-independent); Vercel gates build (slow, DB-aware). Layered checks,
each at the right place.

If the DB-time-of-render coupling becomes a problem later — e.g. a
contributor breaks the build but Vercel doesn't deploy that branch —
revisit and add postgres-service + drizzle-push to the workflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 11:44:26 +02:00

38 lines
923 B
YAML

name: CI
on:
push:
branches: [main]
pull_request:
# Cancel in-progress runs of the same workflow on the same branch — saves
# minutes when commits land in quick succession.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Type check
run: npx tsc --noEmit
- name: Lint
run: npx eslint src/
# `next build` is intentionally NOT here — the App-Router pages do
# DB queries during static pre-render, so a real Postgres would
# need to be set up + migrated + seeded before the build can run.
# Vercel does that on deploy, so this CI focuses on type/lint and
# leaves build verification to Vercel.