Skip to content

ci(deployment): Alchemy-based Cloudflare Workers deployment + type-safe env#1

Merged
edwintantawi merged 3 commits into
mainfrom
ci/deployment
Jul 6, 2026
Merged

ci(deployment): Alchemy-based Cloudflare Workers deployment + type-safe env#1
edwintantawi merged 3 commits into
mainfrom
ci/deployment

Conversation

@edwintantawi

@edwintantawi edwintantawi commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Adds stage-aware Cloudflare Workers deployment via Alchemy and type-safe environment variable validation.

  • Deployment infraalchemy.run.ts orchestrates the TanStack Start worker deploy, resolving domains, observability, and placement per stage (production, staging, preview, local). Per-PR preview URLs are posted back as an auto-updating GitHub comment.
  • GitHub Actions — preview (per-PR), production (push to main), and preview cleanup (on PR close) workflows share a concurrency group so a destroy never races an in-flight deploy.
  • Env validation@t3-oss/env-core + zod schemas validate client and server env vars at build/runtime, catching missing or malformed config early. Adds ALCHEMY_SECRET / ALCHEMY_STATE_TOKEN / HOSTNAME to the schema and .env.example, plus generated Cloudflare binding types.
  • Vite — configured for the Cloudflare target (esnext, external worker modules) and wired to the alchemy plugin.

Commits

  • feat(env): add type-safe environment variable validation
  • ci(deployment): add Alchemy-based Cloudflare Workers deployment

Test plan

  • vp check and vp test pass
  • Preview workflow deploys a per-PR URL and posts it as a comment
  • Production workflow deploys on push to main
  • Cleanup workflow tears down the preview on PR close

Introduce @t3-oss/env-core with zod schemas to validate client and
server environment variables at build/runtime, catching missing or
malformed config early.
Introduce stage-aware deployment infrastructure for Cloudflare Workers via
Alchemy, resolving domains, observability, and placement per stage
(production, staging, preview, local).

- Add alchemy.run.ts orchestrating the TanStack Start worker deploy, with
  per-PR preview URLs posted back as an auto-updating GitHub comment.
- Add GitHub Actions workflows for preview (per-PR), production (push to
  main), and preview cleanup (on PR close), sharing a concurrency group so
  a destroy never races an in-flight deploy.
- Add ALCHEMY_SECRET/ALCHEMY_STATE_TOKEN/HOSTNAME env schema and .env.example
  entries, plus generated Cloudflare binding types.
- Configure Vite for the Cloudflare target (esnext, external worker modules)
  and wire the alchemy plugin.
- Add alchemy scripts, dependencies, and allowed native builds.
Drop the `vp check` step from the preview and production deployment
workflows. Also remove the security note documenting required-reviewer
protection on the preview environment.
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🚀 Preview Deployment (1)

Your changes have been deployed to a preview environment:

Name Preview URL Commit Updated (UTC)
devsantara-website-preview-1 Visit Preview ca7ad42 Mon, 06 Jul 2026 08:27:21 GMT

🏗️ This comment updates automatically with each push.

@edwintantawi edwintantawi self-assigned this Jul 6, 2026
@edwintantawi edwintantawi merged commit c27649a into main Jul 6, 2026
1 check passed
@edwintantawi edwintantawi deleted the ci/deployment branch July 6, 2026 09:55
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