From b86e878e9e117524b411b8102a581c6825b7fae8 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Fri, 12 Jun 2026 12:22:14 -0700 Subject: [PATCH] chore(deploy): make gittensory-api auto-deployable via Workers Builds (migrate + deploy) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gittensory-api (the backend worker) had no automated deploy — only gittensory-ui auto-deploys via Cloudflare Workers Builds — so backend merges piled up unshipped (a 71-commit/5-day backlog incl. the earn-CTA footer). Make deploy:api the canonical backend deploy that applies pending D1 migrations then deploys, so a Workers Builds connection (deploy command: npm run deploy:api) keeps schema + code in sync on every push. wrangler d1 migrations apply is non-interactive in CI and only applies PENDING migrations (no-op when none). Document the per-worker Workers Builds setup + build-watch-paths in CONTRIBUTING. --- CONTRIBUTING.md | 13 +++++++++++-- package.json | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26a2c43d29..61a15bdaa1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -163,8 +163,17 @@ Cloudflare/deploy: `https://gittensory.aethereal.dev/`. - Production API deploys through the `gittensory-api` Cloudflare Worker on `https://gittensory-api.aethereal.dev/`. -- Cloudflare Workers Builds owns automatic UI deployments from GitHub. GitHub Actions UI deploy is - manual validation/fallback only. +- Cloudflare Workers Builds owns automatic deployments from GitHub for BOTH workers (one connection + per worker, scoped by build-watch-paths). GitHub Actions are validation/fallback only — do not add + deploy workflows. + - `gittensory-api` deploy command: `npm run deploy:api` (applies pending D1 migrations, then + `wrangler deploy`). `wrangler d1 migrations apply` is non-interactive in CI and only applies + PENDING migrations, so schema + code stay in sync on every build. Recommended build-watch-paths — + include: `src/**`, `wrangler.jsonc`, `migrations/**`, `package.json`, `package-lock.json`, + `tsconfig*.json`, `drizzle.config.ts`; exclude: `apps/**`, `docs/**`, `**/*.md`. + - `gittensory-ui` build command: `npm run build:cloudflare`. Scope its watch-paths to + `apps/gittensory-ui/**` (note: the UI build runs `ui:openapi` off the API contract, so rebuild the + UI after API OpenAPI changes). - Do not re-add GitHub Pages or static-site deployment workflows. MCP: diff --git a/package.json b/package.json index d1292af3d4..80039da4a2 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "dev": "wrangler dev", "deploy": "wrangler deploy", - "deploy:api": "wrangler deploy", + "deploy:api": "wrangler d1 migrations apply gittensory --remote && wrangler deploy", "cf-typegen": "wrangler types && perl -pi -e 's/[[:blank:]]+$//' worker-configuration.d.ts", "db:migrate:local": "wrangler d1 migrations apply gittensory --local", "db:migrate:remote": "wrangler d1 migrations apply gittensory --remote",