From 7a76f3e628e5ff1cadc814ed2fa1b18822c6e704 Mon Sep 17 00:00:00 2001 From: OG T Date: Tue, 24 Mar 2026 14:36:46 +0800 Subject: [PATCH] fix(cd): Add NEXT_PUBLIC_API_URL build-arg for Web build Root cause: Frontend was compiled with default localhost:8000 instead of production URL https://awoooi.wooo.work This caused all API calls to fail in production because the browser tried to call localhost:8000 which doesn't exist. Next.js NEXT_PUBLIC_* variables are baked in at BUILD TIME, not runtime, so they must be passed via --build-arg. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/cd.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 7b5bbd02..faf3238c 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -142,6 +142,7 @@ jobs: echo "🎨 使用原生 Docker BuildKit 建構 Web..." docker build \ --push \ + --build-arg NEXT_PUBLIC_API_URL=https://awoooi.wooo.work \ --tag ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-web:${{ steps.tag.outputs.tag }} \ --file apps/web/Dockerfile \ .