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 <noreply@anthropic.com>
This commit is contained in:
1
.github/workflows/cd.yaml
vendored
1
.github/workflows/cd.yaml
vendored
@@ -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 \
|
||||
.
|
||||
|
||||
Reference in New Issue
Block a user