Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/deploy-gcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ jobs:
- name: Install dependencies
run: bun install --frozen-lockfile

# .env.production is gitignored (bakes REACT_APP_* into the build at compile time,
# .env.prod is gitignored (bakes REACT_APP_* into the build at compile time,
# there is no runtime config.json like carmen-web) — written here from repo variables
# instead of being committed. Set these under Settings > Secrets and variables > Actions
# > Variables in this repo before the first real deploy.
- name: Write .env.production
# instead of being committed. `build:prod` runs `vite build --mode prod`, which loads
# .env.prod (NOT .env.production). Set these under Settings > Secrets and variables >
# Actions > Variables in this repo before the first real deploy.
- name: Write .env.prod
run: |
cat > .env.production <<EOF
cat > .env.prod <<EOF
REACT_APP_API_BASE_URL=${{ vars.REACT_APP_API_BASE_URL }}
REACT_APP_API_APP_ID=${{ vars.REACT_APP_API_APP_ID }}
REACT_APP_ENV=production
Expand Down
3 changes: 2 additions & 1 deletion scripts/deploy-gcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# <gcs-bucket> ชื่อ bucket (ไม่ต้องมี gs:// นำหน้า)
# [cdn-url-map] (optional) ชื่อ URL map ของ HTTPS LB — ถ้าให้มา จะ invalidate /index.html
# หมายเหตุ: ต่างจาก carmen-web, แอปนี้ bake ค่า REACT_APP_* เข้า bundle ตอน build (ไม่มี
# runtime config.json) ดังนั้นต้องมี .env.production ที่ถูกต้องอยู่ก่อนรันสคริปต์นี้
# runtime config.json) — `build:prod` = `vite build --mode prod` โหลด .env.prod (ไม่ใช่
# .env.production) ดังนั้นต้องมี .env.prod ที่ถูกต้องอยู่ก่อนรันสคริปต์นี้
set -euo pipefail

BUCKET="${1:?Usage: deploy-gcs.sh <bucket> [cdn-url-map]}"
Expand Down
Loading