UniTutor Cloudflare 배포 (Pages + Workers + domain)
UniTutor 원격 배포는 k8s가 아니라 Cloudflare: FE=Pages(dist/), BE=Workers(wrangler).
순서
- (D1 있으면)
d1 migrations apply→ deploy. 일반 규칙: Cloudflare-D1-Migrations-Before-Worker-Deploy.md - Worker
backend—wrangler deploy --config ./wrangler.jsonc(monorepo find-up 회피) - Pages
frontend—wrangler pages deploy는--config커스텀 경로 거부. cwd의wrangler.jsonc만 자동 탐색. Workers와 혼동 금지. - Pages project가 없으면 deploy 전에 project create(CI).
- Custom domain attach (API) → (가능하면) zone CNAME → Smoke.
CI: .github/workflows/deploy.yml. Pages dry-run=tsc/build (테스트 exclude 필요).
Domain (운영 SoR, 2026-10-02)
| 역할 | 호스트 | 비고 |
|---|---|---|
| Pages smoke | unitutor.askwho.net | Dashboard DNS; 첫 green Deploy run 37014651191 / PR #22 |
| Worker API | api.tutor.askwho.net | health 200 유지 |
| Legacy intent | tutor.askwho.net | NXDOMAIN이면 smoke에 쓰지 말 것 (#21 정렬) |
Attach ≠ public DNS
- Pages Domains API attach success alone ≠ public resolve.
digempty + edge 530(1016) 가능. - Same-account attach가 zone DNS를 항상 만들지 않음. Ensure는 idempotent proxied CNAME
host → *.pages.dev(deploy/pages_domain_dns.py)까지. - Compact JSON grep(
"name":"host")는 pretty-print miss → 재POST·400.pages_domain_attached.py로 list+already-exists=success. - Token에 Zone DNS Read/Edit 없으면
dns_records403 → soft-skip Ensure, Smoke/Dashboard 신뢰. Hard-fail로 Smoke를 막지 말 것.
D1 for LTI (2026-10-04)
- LTI Option B needs a real D1 binding. Placeholder
00000000-…0001fails Worker deploy (CF 10181). wrangler d1 create unitutor→ commit uuid intobackend/wrangler.jsonc(example uuid7bc6be4d-4809-4faa-9f38-4a9d7973b6be).npm run deploy=d1 migrations apply DB --remotethenwrangler deploy.FRONTEND_ORIGINprod:https://unitutor.askwho.net.- LTI/JWKS smoke uses temporary
lti_deploymentsrow then deletes it — see UniTutor-LTI-13-B2B.md.
Single-env prod gate (k8s tenant_cd 아님)
- UniTutor는
.factory/cd.yaml/ta.tenant_cd[]미등록 → Cloudflare Pages+Workers 단일 환경; merge 후deploy.yml이 곧 prod. - prod gate = main SHA 일치 + Deploy success + public smoke (
api.tutor/unitutor.askwho.net). - PathChrome UI 롤아웃 예: merge
73178e8/ Actions 38196130315 — UniTutor-PathChrome-Gating-Strip.md.
게이트
- Secrets:
CLOUDFLARE_API_TOKEN,CLOUDFLARE_ACCOUNT_ID. prod:증거 = public DNS + HTTP 200 (530/NXDOMAIN 아님).- 첫 원격 closeout: merge
bd40a573/ Actions 37014651191.