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
34 lines
2.0 KiB
Markdown
34 lines
2.0 KiB
Markdown
# 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)
|
|
1. Checkout → Set up Bun 1.3.14 → `bun install --frozen-lockfile`
|
|
2. Typecheck (`bun run typecheck`)
|
|
3. Build web (`working-directory: apps/web && bun run build`) ← **Build happens here, not VPS**
|
|
4. Upload `.next/` as artifact (`include-hidden-files: true` ← critical for hidden `.next/` dir)
|
|
5. MCP smoke test (conditional on DATABASE_URL secret — skipped in CI without DB)
|
|
6. Unit tests (`bun run test`)
|
|
|
|
**Job 2: `deploy`** (needs: build, main branch only)
|
|
1. Download artifact to `apps/web/.next`
|
|
2. Tar `.next` (exclude cache, ~15MB tarball)
|
|
3. SCP tarball to VPS (`/tmp/`)
|
|
4. SSH to VPS: `git pull` → `bun install` → `bun run scripts/indexer.ts` → `tar -xzf` → `systemctl restart`
|
|
|
|
### Key Fixes During This Phase
|
|
|
|
1. **`actions/checkout@v4` → `@v5`** — Node 20 deprecation warning
|
|
2. **`bun --cwd apps/web run build` → `working-directory: apps/web`** — `bun run` doesn't support `--cwd` flag; was silently printing usage, exiting 0
|
|
3. **`path: apps/web/.next/`** → **`path: apps/web/.next`** + **`include-hidden-files: true`** — `.next/` is a hidden directory; `upload-artifact@v4` excludes hidden files by default
|
|
4. **`bun --cwd apps/mcp run smoke`** → **`working-directory: apps/mcp`** — same `--cwd` bug
|
|
5. **Smoke test made conditional** on `DATABASE_URL` — was silently failing (never actually ran due to bug #2/#4)
|
|
6. **SCP of individual `.next/*`** → **tarball transfer** — SCP with glob of hidden files was failing/timing out
|
|
7. **Deploy tarball excludes `.next/cache`** — cache is ephemeral, reduces transfer size
|
|
8. **Merged ci.yml + deploy.yml** into single workflow — `workflow_run` trigger can't access artifacts from CI run
|