Commit Graph
21 Commits
Author SHA1 Message Date
asepharyana 5195a65ca5 ci: use sudo when syncing .next on VPS
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) — api (push) Canceled after 0s
CI / build + deploy (Nix) — mcp (push) Canceled after 0s
CI / build + deploy (Nix) — worker (push) Canceled after 0s
CI / build + deploy (web) (push) Canceled after 0s
2026-08-22 12:08:20 +07:00
asepharyana 8adfffb6e7 fix(deploy): correctly copy prebuilt .next to apps/web/.next on VPS during deployment 2026-08-22 12:00:30 +07:00
asepharyana 96b8765966 ci: sync git repository on VPS during deployment 2026-08-22 11:50:27 +07:00
asepharyana 54d5c0ee01 ci: simplify web.nix (symlink .next, bunx next start from repo), fix CI args
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) — api (push) Canceled after 0s
CI / build + deploy (Nix) — mcp (push) Canceled after 0s
CI / build + deploy (Nix) — worker (push) Canceled after 0s
CI / build + deploy (web) (push) Canceled after 0s
2026-08-21 17:50:30 +07:00
asepharyana c92caede57 ci: fix SSH variable escaping in deploy step ( not \)
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) — api (push) Canceled after 0s
CI / build + deploy (Nix) — mcp (push) Canceled after 0s
CI / build + deploy (Nix) — worker (push) Canceled after 0s
CI / build + deploy (web) (push) Canceled after 0s
2026-08-21 17:27:23 +07:00
asepharyana aedcfbf4e7 fix: nix build with dontFixup for .bun symlink issues, use root node_modules + Attic cache push
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) — api (push) Canceled after 0s
CI / build + deploy (Nix) — mcp (push) Canceled after 0s
CI / build + deploy (Nix) — worker (push) Canceled after 0s
CI / build + deploy (web) (push) Canceled after 0s
2026-08-21 17:03:28 +07:00
asepharyana c6b0b2549a ci: use Attic binary cache push + nix-store substitute (not SSH copy)
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) — api (push) Canceled after 0s
CI / build + deploy (Nix) — mcp (push) Canceled after 0s
CI / build + deploy (Nix) — worker (push) Canceled after 0s
CI / build + deploy (web) (push) Canceled after 0s
- Bootstrap attic client from gmw cache (HTTPS substituter)
- Push store paths to pub:mcpedia cache
- VPS substitutes from mcpedia cache (fast) instead of nix copy --to ssh://
- Fallback to SSH copy if Attic push fails
2026-08-21 16:41:56 +07:00
asepharyana 34b3b8f56b ci: fix nix-build SSH args, web.nix path handling, NIX_SSHOPTS inline
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) — api (push) Canceled after 0s
CI / build + deploy (Nix) — mcp (push) Canceled after 0s
CI / build + deploy (Nix) — worker (push) Canceled after 0s
CI / build + deploy (web) (push) Canceled after 0s
2026-08-21 16:16:53 +07:00
asepharyana 5fdf5ffb64 ci: Nix-based build + deploy for all services
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) (api) (push) Canceled after 0s
CI / build + deploy (Nix) (mcp) (push) Canceled after 0s
CI / build + deploy (Nix) (worker) (push) Canceled after 0s
CI / build + deploy (web) (push) Canceled after 0s
- flake.nix: 4 packages (web, api, mcp, worker) built via bun in Nix
- web.nix: pre-built .next packaged into Nix store (avoids Turbopack/Bun sandbox issue)
- ci.yml: test (bun) → build-and-deploy (api/mcp/worker via nix build) + deploy-web (.next artifact → nix-build web.nix)
- Deploy: nix copy → nix-env --set + systemctl restart (no tarball+SSH, no VPS builds)
- systemd units updated to use Nix profile paths (/nix/var/nix/profiles/mcpedia-*)
2026-08-21 15:56:22 +07:00
asepharyana b88e9b796c ci: migrate to Nix-based build + deploy
CI / typecheck + tests (push) Canceled after 0s
CI / build + deploy (Nix) (api) (push) Canceled after 0s
CI / build + deploy (Nix) (mcp) (push) Canceled after 0s
CI / build + deploy (Nix) (web) (push) Canceled after 0s
CI / build + deploy (Nix) (worker) (push) Canceled after 0s
- Add flake.nix with 4 packages: web, api, mcp, worker
  Each builds via bun in CI sandbox, packages dist/.next + node_modules
  into Nix store, wraps with makeBinaryWrapper
- Rewrite ci.yml: test (bun typecheck+tests) → build-and-deploy (Nix matrix)
  nix build → nix copy → nix-env --set + systemctl restart on VPS
  No tarball+SSH, no VPS builds
- Gitignore content/**/*.md (DB is source of truth)
- Update AGENTS.md architecture docs
2026-08-21 15:30:48 +07:00
asepharyana ea75d68b1a fix: Phase 14 + Phase 15 — UI/UX polish + CI/CD restructure
CI / typecheck + build (push) Canceled after 0s
CI / deploy to VPS (push) Canceled after 0s
=== UI/UX (Phase 14 + 15) ===
- Remove 'body' field from showing as custom badge (added to STANDARD_KEYS)
- Capitalize doc type: 'documentation' → 'Documentation', 'writeup' → 'Writeup'
- Sidebar tree: border-l per depth level + section separators (tee-style)
- Homepage tree: use doc titles from DB (not path segments)
- Centralize section config in packages/config/src/sections.ts (no hardcode in UI)
- Client-safe config entrypoint: @mcpedia/config/sections (avoids node:fs in client)

=== CI/CD (Phase 15b) ===
- Bump actions/checkout v4 → v5 (Node 20 deprecation)
- Fix: 'bun --cwd X run Y' doesn't work (bun run rejects --cwd flag)
  → use 'working-directory: X' instead
- Fix: .next/ is a hidden directory — upload-artifact needs include-hidden-files: true
- Merge CI + Deploy into single workflow (workflow_run can't share artifacts)
- VPS no longer builds: CI builds .next/ → uploads artifact → VPS deploys via tarball+scp+ssh
- MCP smoke test made conditional on DATABASE_URL (CI has no Postgres)
2026-08-21 12:59:05 +07:00
asepharyana f14f3e92c5 debug: use absolute path for upload-artifact 2026-08-21 12:13:11 +07:00
asepharyana 6077476254 debug: fix duplicate ls step, use .next without trailing slash
CI / typecheck + build (push) Canceled after 0s
CI / deploy to VPS (push) Canceled after 0s
2026-08-21 12:09:47 +07:00
asepharyana b7d8c455d4 chore: add debug step to list .next contents in CI 2026-08-21 12:07:02 +07:00
asepharyana 0234c5cbe6 fix: make MCP smoke test conditional on DATABASE_URL
Smoke test was never running in CI (silently skipped due to 'bun --cwd' bug).
Now that it runs, it fails because CI has no Postgres access. Make the smoke
test conditional on env.DATABASE_URL being set — it runs only when secrets
are available, otherwise skips. Unit tests (auth.test.ts) still cover tool
registration logic without a DB.
2026-08-21 12:02:26 +07:00
asepharyana 628068e33d fix: CI build steps — use 'cd X && bun run' not 'bun --cwd'
Root cause: 'bun run' subcommand does NOT support --cwd flag. Both
'Build web' and 'MCP smoke test' steps used 'bun --cwd apps/X run build/smoke'
which silently printed usage and exited 0 — no actual build/test ran.
This meant:
1. No .next/ was produced → artifact upload found no files → deploy failed
2. Smoke test was silently skipped

Fix: use 'cd apps/X && bun run Y' pattern instead.
2026-08-21 11:53:15 +07:00
asepharyana 074fa9f316 fix: merge CI + Deploy into single workflow (fixes artifact sharing)
CI / typecheck + build (push) Canceled after 0s
CI / deploy to VPS (push) Canceled after 0s
The workflow_run trigger can't access artifacts from the CI run — this
is a known GitHub Actions limitation. Merged deploy into ci.yml as a
'needs: build' job so artifacts are shared properly.

Key changes:
- ci.yml: unified build+deploy workflow
- Build job: typecheck, build web, test, smoke, upload .next artifact
- Deploy job (needs: build): download artifact, SCP to VPS, git pull +
  index + restart. No build on VPS.
- artifact retention: 1 day (only needed for immediate deploy)
2026-08-21 11:49:22 +07:00
asepharyana 77792c624b fix: CI/CD — move web build to CI, VPS only deploys (no build on VPS)
- ci.yml: add web build step + upload .next as artifact
- deploy.yml: download artifact via SCP, copy to VPS .next dir
  (no bun run build on VPS — only git pull + install + index + restart)
- Bump actions/checkout@v4 → @v5 (Node 20 deprecation)
- Revert next.config standalone mode (not needed for .next/ copy approach)
- Remove broken bun --cwd (doesn't support --cwd flag)
2026-08-21 11:43:21 +07:00
asepharyana 90e40c4d48 fix: CI/CD — replace broken bun --cwd with turbo --filter for web build
CI / typecheck + build (turbo) (push) Canceled after 0s
The deploy workflow used 'bun --cwd apps/web run build' which does NOT
work — 'bun run' doesn't support --cwd flag. Bun prints usage and exits
0, making the step silently succeed without building. Fix: use
'bun run build --filter=@mcpedia/web' (turbo workspace filtering).

Also bump actions/checkout@v4→v5 to resolve Node 20 deprecation warning.
2026-08-21 11:20:06 +07:00
asepharyana 76f778c10d chore(testing): Phase 9 — bun:test suite + CI gating with no-DB fakes
CI / typecheck + build (turbo) (push) Canceled after 0s
Added a real test suite (32 tests, 0 external services) using bun:test with
in-process module mocking for @mcpedia/db, @mcpedia/queue, @mcpedia/core.

Enablers:
- apps/api: extracted createApp(deps?) factory + dashboard.ts module from
  index.ts so the HTTP surface is unit-testable (real queue is lazy-imported).
- packages/core: exported shouldCreateRevision pure predicate; restoreRevision
  gained an opts.reindex seam for the chunk-rebuild contract.
- apps/mcp: renamed smoke.test.ts -> smoke.ts (bun test now owns .test.ts),
  updated stale assertions (10 tools, 4 docs in docs section).
- infra: turbo test task (cache:false), test scripts across packages,
  @types/bun + tsconfig base types, CI 'Test' step after Build.

Packages with tests: embeddings(5), parser(5), search(8), core(4),
mcp(6 auth-gates), api(8 contracts).

All green: typecheck(4/4), test(6/6 pkgs), build(web). Live API verified
/health, /metrics, /dashboard, /hooks/* auth gate on temp port.
2026-08-20 11:12:32 +07:00
asepharyana a659ebeec2 ci: add GitHub Actions workflow (Bun + turbo typecheck/build + MCP smoke)
CI / typecheck + build (turbo) (push) Canceled after 0s
Builds the whole monorepo on push/PR to main: bun install --frozen-lockfile,
turbo typecheck, turbo build (incl. Next.js web prerender), and the MCP
in-memory smoke test. No external services required for CI.
2026-08-19 22:10:47 +07:00