Skip to content

feat(ci): CI checks + Workers deploy workflow - #25

Merged
pedro-pinheiro002 merged 2 commits into
mainfrom
feat/ci-deploy
Oct 3, 2026
Merged

pedro-pinheiro002 merged 2 commits into
mainfrom
feat/ci-deploy

Conversation

@pedro-pinheiro002

Copy link
Copy Markdown
Owner

Lane D of the deploy plan (ADR-0002/0003/0004).

  • .github/workflows/ci.yml — job ci: pnpm (from packageManager) + Node 24 (from .nvmrc) + pnpm install --frozen-lockfile, then typecheck / test (139) / format:check, on pull_request and push to main. This job name is the check context the upcoming main-branch ruleset will require.
  • Job deploy: only on push to main, needs: ci: pnpm exec wrangler d1 migrations apply ytb-index --remote then pnpm exec wrangler deploy, authed with the CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID secrets (env vars are wrangler's documented CI auth). Direct invocation instead of cloudflare/wrangler-action: same pinned wrangler 4.147.0 as local dev, fewer moving parts (Cloudflare documents both).
  • README + .env.example: corrected token guidance — the "Edit Cloudflare Workers" template does not include D1 Write; it must be added (scoped to the account) for migrations apply and remote ingest.

Required before merging: the CLOUDFLARE_API_TOKEN secret must be re-created/edited to add D1 Write (Account, scoped to the one account) — otherwise the deploy job's migrations step fails 403.

Job `ci` (typecheck + test + format:check) on pull_request and push to main — this is the check context the main-branch ruleset will require. Job `deploy` runs only on push to main after ci: wrangler d1 migrations apply --remote then wrangler deploy, authed via CLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID secrets (direct pnpm exec wrangler — same pinned wrangler as local dev; Cloudflare documents this alongside the action). Corrects the token guidance: the 'Edit Cloudflare Workers' template does NOT include D1 Write — add D1 Write, scoped to the account.
Node 24.19.0 backported ObjectWrap cleanup hooks without the registry follow-up (nodejs/node#65446): any addon compiled against 24.19+ headers aborts at Statement::~Statement during teardown. better-sqlite3 11.10.0 ships no Node 24 prebuild, so CI compiled it from source against 24.21 headers and crashed; local 24.16.0 passed. 13.x is the N-API rewrite (WiseLibs/better-sqlite3#1498): the node::ObjectWrap destructor path is gone, prebuilds are bundled (no node-gyp on CI), and our API surface (Database/prepare/run/get/all/exec/pragma/transaction/close) is unchanged. Node >= 22 required — .nvmrc stays 24.
@pedro-pinheiro002
pedro-pinheiro002 merged commit d5373ae into main Oct 3, 2026
2 checks passed
@pedro-pinheiro002
pedro-pinheiro002 deleted the feat/ci-deploy branch October 3, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant