Deploying
The CI pipeline, manual runs, and the move to accounts.dylog.ai.
Pipeline
Every push to master or staging runs .github/workflows/deploy.yml:
- Verify credentials and secrets for the target environment.
- Typecheck.
- Ensure the D1 database exists and apply pending migrations.
- Seed fixture accounts (dev and staging only).
- Build with OpenNext and deploy the Worker with
--keep-vars. - Push runtime secrets.
- Smoke test
/api/auth/okand/api/auth/jwks.
Run it by hand from the Actions tab (choose the environment) or:
gh workflow run deploy.yml --repo dyloginc/accounts --ref master -f environment=productionMoving production to accounts.dylog.ai
- Add the
dylog.aizone to Cloudflare (or confirm it is already there) and switch nameservers. - In
wrangler.jsoncproduction, addroutes: [{ "pattern": "accounts.dylog.ai", "custom_domain": true }]. Cloudflare creates the DNS record and certificate on deploy. - In the same commit set
BETTER_AUTH_URL=https://accounts.dylog.ai,COOKIE_DOMAIN=.dylog.ai, and pointRETURN_TO_ORIGINSat each sub-app'sdylog.aiorigin. - Before deploying, make backends accept the new issuer alongside the old one.
- After deploying: everyone signs in once more (new cookie domain), passkeys must be re-registered (new relying party), and the old issuer can be retired from backends once tokens have expired.
Observability
Worker logs (with query strings redacted) are in the Cloudflare dashboard under the Worker's Logs tab, or
live with wrangler tail accounts. Emails that could not be sent are logged there too.