StackBlitz ↔ GitHub: Preserving Env Vars Across Branch Switches
0 reputation · 14 Aug 2022, 17:51 UTC
Goal: Zero‑downtime migration of a small web app from GitHub to StackBlitz
When a project is linked to a GitHub branch, StackBlitz automatically commits editor changes back to that branch and offers a live preview that updates on each commit. The Deploy to Vercel/Netlify button builds the current branch and publishes a preview URL, enabling a seamless transition to production without downtime if immutable URLs are used.
Unresolved behavior
The platform’s documentation does not specify whether environment variable values set via the StackBlitz UI are persisted per branch or shared across all linked branches. This uncertainty could affect the reliability of a zero‑downtime migration when switching between feature and main branches.
Key questions for a reliable migration strategy:
- Does StackBlitz store environment variables uniquely for each linked branch, or are they shared globally?
- If variables are not branch‑specific, what workflow or tooling can guarantee consistent values across branches during a live migration?
- Are there recommended patterns to avoid temporary service disruption when a branch switch triggers a new build and redeploy?