ci: set build-arg URLs to same-origin public host

API_BASE_URL=/api fails Zod's .url() validator at runtime in the browser.
Pass the full https://ui-dashboard.gnerim.ru/api so it parses; same-origin
fetch behaviour is preserved because the public host serves the SPA.
MAP_TILE_URL gets the same treatment for consistency (its schema doesn't
.url()-validate, but a real URL is cleaner).
This commit is contained in:
2026-04-27 15:22:29 +03:00
parent 6e7e931e4e
commit f17961d523
+5 -2
View File
@@ -71,8 +71,11 @@ jobs:
- name: Build SSR image
id: docker_build
env:
MAP_TILE_URL: ${{ secrets.MAP_TILE_URL || '/map/api/tile/{z}/{x}/{y}.jpeg' }}
API_BASE_URL: ${{ secrets.API_BASE_URL || '/api' }}
# Both must be full URLs — Zod's .url() validator in src/env/index.ts
# rejects relative paths at runtime in the browser. Same-origin works
# because the public host is also where nginx is.
MAP_TILE_URL: ${{ secrets.MAP_TILE_URL || 'https://ui-dashboard.gnerim.ru/map/api/tile/{z}/{x}/{y}.jpeg' }}
API_BASE_URL: ${{ secrets.API_BASE_URL || 'https://ui-dashboard.gnerim.ru/api' }}
run: |
docker build -f Dockerfile.react \
--build-arg "MAP_TILE_URL=${MAP_TILE_URL}" \