ci(deployment): Alchemy-based Cloudflare Workers deployment + type-safe env#1
Merged
Conversation
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.
🚀 Preview Deployment (1)Your changes have been deployed to a preview environment:
🏗️ This comment updates automatically with each push. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds stage-aware Cloudflare Workers deployment via Alchemy and type-safe environment variable validation.
alchemy.run.tsorchestrates 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.main), and preview cleanup (on PR close) workflows share a concurrency group so a destroy never races an in-flight deploy.@t3-oss/env-core+ zod schemas validate client and server env vars at build/runtime, catching missing or malformed config early. AddsALCHEMY_SECRET/ALCHEMY_STATE_TOKEN/HOSTNAMEto the schema and.env.example, plus generated Cloudflare binding types.Commits
feat(env): add type-safe environment variable validationci(deployment): add Alchemy-based Cloudflare Workers deploymentTest plan
vp checkandvp testpassmain