From f17961d5238ed70f7b3a1dc3f86d59e08e584b15 Mon Sep 17 00:00:00 2001 From: gnezim Date: Mon, 27 Apr 2026 15:22:29 +0300 Subject: [PATCH] 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). --- .gitea/workflows/ci-deploy.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci-deploy.yml b/.gitea/workflows/ci-deploy.yml index 7e23bb16..5b3d34c0 100644 --- a/.gitea/workflows/ci-deploy.yml +++ b/.gitea/workflows/ci-deploy.yml @@ -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}" \