From a68446022c33f90348683fb8c5c5ad10e4d1fcac Mon Sep 17 00:00:00 2001 From: Bruno Menezes Date: Wed, 4 Dec 2024 19:18:31 +1300 Subject: [PATCH] chore(ci): Set temporary preview var for Docker builds. --- .github/workflows/docker.yaml | 2 +- apps/web/.env.sunodo | 2 ++ docker-bake.hcl | 7 +++++++ docker/Dockerfile | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index b7ef8d70a..095b0fac2 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -12,7 +12,7 @@ permissions: packages: write id-token: write env: - NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL: ${{vars.NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL}} + PREVIEW_API_URL: ${{vars.NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL}} jobs: build: runs-on: ubuntu-latest diff --git a/apps/web/.env.sunodo b/apps/web/.env.sunodo index 8cb358a6c..31b355f81 100644 --- a/apps/web/.env.sunodo +++ b/apps/web/.env.sunodo @@ -2,3 +2,5 @@ NEXT_PUBLIC_CHAIN_ID=31337 NEXT_PUBLIC_EXPLORER_API_URL="http://localhost:8080/explorer-api/graphql" INTERNAL_EXPLORER_API_URL="http://explorer_api:4350/graphql" BASE_PATH="/explorer" +# TODO: Remove temp variable expansion +NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL=${PREVIEW_API_URL} diff --git a/docker-bake.hcl b/docker-bake.hcl index 5d8fbe5d9..c49c7757f 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,11 +1,18 @@ target "docker-metadata-action" {} target "docker-platforms" {} +# TODO: Remove temporary variable +variable "PREVIEW_API_URL" { + default = "http://localhost:4350/graphql" +} + target "default" { inherits = ["docker-metadata-action", "docker-platforms"] dockerfile = "docker/Dockerfile" context = "." args = { "ENVIRONMENT" = "sunodo" + # TODO: Remove temporary variable + "PREVIEW_API_URL" = "${PREVIEW_API_URL}" } } diff --git a/docker/Dockerfile b/docker/Dockerfile index 92d5fbea7..a29df933f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -25,6 +25,8 @@ RUN yarn install # Build the project COPY --from=builder /app/out/full/ . ARG ENVIRONMENT=localhost +# TODO: Remove temporary variable +ARG PREVIEW_API_URL COPY --from=builder /app/out/full/apps/web/.env.${ENVIRONMENT} ./apps/web/.env RUN yarn build --filter=web