Phase 15c — theme-consistent color system: Replaced 63 instances of hardcoded hex colors (#5e6ad2, #7170ff, #4f46e5, #6a75e0, #828fff, #94a3b8, etc.) with CSS variables from globals.css: - #5e6ad2 → var(--brand) (light: #5e6ad2, dark: #5e6ad2) - #7170ff → var(--accent) (light: #4f46e5, dark: #7170ff) - #4f46e5 → var(--accent) - #6a75e0 → var(--brand-hover) (new var, light: #6a75e0, dark: #7170ff) - #828fff → var(--accent-hover) - #868686 → var(--text-dim) - Dark-mode-specific hex in Markdown.tsx → CSS variables Added --brand-hover CSS variable (light: #6a75e0, dark: #7170ff) Added dark:prose-invert instead of prose-invert (light mode now uses default prose theme instead of forced dark) Files changed: 15 component files + globals.css
2.0 KiB
2.0 KiB
Phase 15b — CI/CD: Build in CI, Deploy only on VPS
User: "alur ci nya juga benarkan lah masa build di vps,harusnya kan di vps hanya deploy, dan seharusnya pakai nix"
Final Architecture
CI Workflow (.github/workflows/ci.yml)
Single workflow with two jobs:
Job 1: build (runs on GitHub Actions runner)
- Checkout → Set up Bun 1.3.14 →
bun install --frozen-lockfile - Typecheck (
bun run typecheck) - Build web (
working-directory: apps/web && bun run build) ← Build happens here, not VPS - Upload
.next/as artifact (include-hidden-files: true← critical for hidden.next/dir) - MCP smoke test (conditional on DATABASE_URL secret — skipped in CI without DB)
- Unit tests (
bun run test)
Job 2: deploy (needs: build, main branch only)
- Download artifact to
apps/web/.next - Tar
.next(exclude cache, ~15MB tarball) - SCP tarball to VPS (
/tmp/) - SSH to VPS:
git pull→bun install→bun run scripts/indexer.ts→tar -xzf→systemctl restart
Key Fixes During This Phase
actions/checkout@v4→@v5— Node 20 deprecation warningbun --cwd apps/web run build→working-directory: apps/web—bun rundoesn't support--cwdflag; was silently printing usage, exiting 0path: apps/web/.next/→path: apps/web/.next+include-hidden-files: true—.next/is a hidden directory;upload-artifact@v4excludes hidden files by defaultbun --cwd apps/mcp run smoke→working-directory: apps/mcp— same--cwdbug- Smoke test made conditional on
DATABASE_URL— was silently failing (never actually ran due to bug #2/#4) - SCP of individual
.next/*→ tarball transfer — SCP with glob of hidden files was failing/timing out - Deploy tarball excludes
.next/cache— cache is ephemeral, reduces transfer size - Merged ci.yml + deploy.yml into single workflow —
workflow_runtrigger can't access artifacts from CI run