ci: fix vite env vars not passed when build
Some checks failed
Build and Publish Docker Image / build-and-push (push) Failing after 2m20s
Some checks failed
Build and Publish Docker Image / build-and-push (push) Failing after 2m20s
Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
6
.github/workflows/docker-publish.yml
vendored
6
.github/workflows/docker-publish.yml
vendored
@@ -49,6 +49,12 @@ jobs:
|
|||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
build-args: |
|
||||||
|
VITE_API_URL=${{ vars.VITE_API_URL }}
|
||||||
|
VITE_DEFAULT_LATITUDE=${{ vars.VITE_DEFAULT_LATITUDE }}
|
||||||
|
VITE_DEFAULT_LONGITUDE=${{ vars.VITE_DEFAULT_LONGITUDE }}
|
||||||
|
|
||||||
- name: Output image URLs
|
- name: Output image URLs
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@@ -13,6 +13,17 @@ RUN bun install --frozen-lockfile
|
|||||||
|
|
||||||
# Build dashboard stage
|
# Build dashboard stage
|
||||||
FROM base AS dashboard-builder
|
FROM base AS dashboard-builder
|
||||||
|
|
||||||
|
# Accept build arguments for Vite environment variables
|
||||||
|
ARG VITE_API_URL
|
||||||
|
ARG VITE_DEFAULT_LATITUDE
|
||||||
|
ARG VITE_DEFAULT_LONGITUDE
|
||||||
|
|
||||||
|
# Set as environment variables for Vite build
|
||||||
|
ENV VITE_API_URL=${VITE_API_URL}
|
||||||
|
ENV VITE_DEFAULT_LATITUDE=${VITE_DEFAULT_LATITUDE}
|
||||||
|
ENV VITE_DEFAULT_LONGITUDE=${VITE_DEFAULT_LONGITUDE}
|
||||||
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=deps /app/apps/dashboard/node_modules ./apps/dashboard/node_modules
|
COPY --from=deps /app/apps/dashboard/node_modules ./apps/dashboard/node_modules
|
||||||
COPY apps/dashboard ./apps/dashboard
|
COPY apps/dashboard ./apps/dashboard
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
# Vite environment variables for dashboard build
|
||||||
|
VITE_API_URL: ${VITE_API_URL:-http://localhost:8000}
|
||||||
|
VITE_DEFAULT_LATITUDE: ${VITE_DEFAULT_LATITUDE:-37.7749}
|
||||||
|
VITE_DEFAULT_LONGITUDE: ${VITE_DEFAULT_LONGITUDE:--122.4194}
|
||||||
image: eva-monorepo:latest
|
image: eva-monorepo:latest
|
||||||
container_name: eva
|
container_name: eva
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
Reference in New Issue
Block a user