fix(ci): write .env.prod (not .env.production) so the prod build finds its env#37
Merged
Merged
Conversation
…s its env
`build:prod` runs `vite build --mode prod`, which loads `.env.prod`. The deploy
workflow wrote `.env.production` — a name Vite never loads for mode "prod" — so
the file was ignored and the build failed the env guard:
Error: [env] Missing REACT_APP_API_BASE_URL, REACT_APP_API_APP_ID for mode "prod".
Left over from the env refactor (#33) that renamed .env.production -> .env.prod
and switched to explicit `--mode prod`; the workflow and the deploy-gcs.sh
comment still referenced the old name. Rename the written file to .env.prod and
fix the stale comments.
Verified locally: `bun run build:prod` succeeds with a .env.prod present.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
samutpra
added a commit
that referenced
this pull request
Jul 16, 2026
commit 79843fa Merge: 203c0cc 00a2a88 Author: Thammanoon Semapru <samutpra@users.noreply.github.com> Date: Thu Jul 16 15:34:20 2026 +0700 Merge pull request #37 from CarmenSoftware-organization/fix/deploy-env-prod-filename fix(ci): write .env.prod (not .env.production) so the prod build finds its env commit 00a2a88 Author: Thammanoon Semapru <samutpra@users.noreply.github.com> Date: Thu Jul 16 15:32:45 2026 +0700 fix(ci): write .env.prod (not .env.production) so the prod build finds its env `build:prod` runs `vite build --mode prod`, which loads `.env.prod`. The deploy workflow wrote `.env.production` — a name Vite never loads for mode "prod" — so the file was ignored and the build failed the env guard: Error: [env] Missing REACT_APP_API_BASE_URL, REACT_APP_API_APP_ID for mode "prod". Left over from the env refactor (#33) that renamed .env.production -> .env.prod and switched to explicit `--mode prod`; the workflow and the deploy-gcs.sh comment still referenced the old name. Rename the written file to .env.prod and fix the stale comments. Verified locally: `bun run build:prod` succeeds with a .env.prod present. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> commit 203c0cc Author: Thammanoon Semapru <samutpra@users.noreply.github.com> Date: Thu Jul 16 15:27:36 2026 +0700 chore: rename .env.uat to .env.production in GCS deployment workflow commit 84b711e Author: Thammanoon Semapru <samutpra@users.noreply.github.com> Date: Thu Jul 16 15:24:47 2026 +0700 chore: rename generated .env.production to .env.uat in deployment workflow commit c267613 Author: Thammanoon Semapru <samutpra@users.noreply.github.com> Date: Thu Jul 16 15:23:03 2026 +0700 chore: remove GCP deployment workflow file
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.
Problem
The GCP deploy workflow fails at build with:
scripts/deploy-gcs.shrunsbun run build:prod→vite build --mode prod, and Vite--mode prodloads.env.prod. But the workflow's "Write .env.production" step created.env.production— a filename Vite never loads for modeprod— so the env file was silently ignored and thevite.config.tsguard threw.Left over from the env refactor (#33) that renamed
.env.production→.env.prodand switched every script to an explicit--mode;deploy-gcs.ymland thedeploy-gcs.shcomment still referenced the old name.Fix
.env.prod(matching what--mode prodloads).deploy-gcs.sh.Verification
bun run build:prodsucceeds locally with a.env.prodpresent (✓ built in ~4s), confirming the filename is what the prod build resolves.Note
Repo Variables
REACT_APP_API_BASE_URL/REACT_APP_API_APP_IDmust be set under Settings → Secrets and variables → Actions → Variables (trusted, admin-set config — not attacker-controllable event input). The workflow isworkflow_dispatchonly (manual), so this does not run on merge.🤖 Generated with Claude Code