Skip to content

Commit

Permalink
chore(ci): Set temporary preview var for Docker builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomenezes committed Dec 4, 2024
1 parent eb63adc commit a684460
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions apps/web/.env.sunodo
Original file line number Diff line number Diff line change
Expand Up @@ -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}
7 changes: 7 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -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}"
}
}
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a684460

Please sign in to comment.