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:
OG T
2026-03-24 14:36:46 +08:00
parent 774290d333
commit 7a76f3e628

View File

@@ -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 \
.