From cbc46d5e4b228215622b751757c0988693b01e89 Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Thu, 12 Dec 2024 15:12:15 +0400 Subject: [PATCH] fix: pass decap env vars to fe_build workflow --- .lagoon/Dockerfile | 10 +++++----- apps/decap/turbo.json | 1 + apps/publisher/publisher.config.ts | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.lagoon/Dockerfile b/.lagoon/Dockerfile index 2a0319b1a..9027aeeb8 100644 --- a/.lagoon/Dockerfile +++ b/.lagoon/Dockerfile @@ -35,11 +35,6 @@ RUN --mount=type=cache,target=/tmp/cache composer install --no-dev WORKDIR /app -# Decap config. -ENV VITE_DECAP_REPO='AmazeeLabs/silverback-template' -ARG LAGOON_GIT_BRANCH -ENV VITE_DECAP_BRANCH="$LAGOON_GIT_BRANCH" - # Copy the all package sources, install and prepare them. COPY . /app RUN --mount=type=cache,target=/tmp/cache pnpm i && \ @@ -118,4 +113,9 @@ RUN npm install -g pnpm@8.15.9 COPY --from=builder /tmp/.deploy/publisher /app +# Decap config. +ENV VITE_DECAP_REPO='AmazeeLabs/silverback-template' +ARG LAGOON_GIT_BRANCH +ENV VITE_DECAP_BRANCH="$LAGOON_GIT_BRANCH" + CMD pnpm publisher diff --git a/apps/decap/turbo.json b/apps/decap/turbo.json index b6cfb94b3..5762cd9b7 100644 --- a/apps/decap/turbo.json +++ b/apps/decap/turbo.json @@ -3,6 +3,7 @@ "extends": ["//"], "tasks": { "prep:vite": { + "env": ["VITE_DECAP_REPO", "VITE_DECAP_BRANCH"], "dependsOn": ["^prep"], "inputs": ["src/**", "vite.config.ts", "index.html"], "outputs": ["dist/**"] diff --git a/apps/publisher/publisher.config.ts b/apps/publisher/publisher.config.ts index 4f40ae0e4..65111013a 100644 --- a/apps/publisher/publisher.config.ts +++ b/apps/publisher/publisher.config.ts @@ -72,6 +72,8 @@ function githubEnvVars(): Record { 'PUBLISHER_OAUTH2_SESSION_SECRET', 'PUBLISHER_OAUTH2_ENVIRONMENT_TYPE', 'PUBLISHER_OAUTH2_TOKEN_HOST', + 'VITE_DECAP_REPO', + 'VITE_DECAP_BRANCH', ].map((name) => { if (name === 'DRUPAL_INTERNAL_URL') { // No internal URLs when building on Github.