Skip to content

Commit

Permalink
pass ARG_SITE_URL in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanjam committed May 15, 2024
1 parent 510a70f commit 92eb7ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/build-push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:

env:
IMAGE_NAME: ${{ github.event.repository.name }}
# set this
SITE_URL: 'https://docker.nemanjamitic.com'

jobs:
Expand Down Expand Up @@ -58,6 +57,8 @@ jobs:
context: ./
# Dockerfile dir
file: ./docker/Dockerfile
build-args: |
"ARG_SITE_URL=${{ env.SITE_URL }}"
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest
# disabled metadata step
Expand Down
6 changes: 6 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ FROM base AS build
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . .

# build time only env var
ARG ARG_SITE_URL
ENV SITE_URL=$ARG_SITE_URL
RUN echo "SITE_URL=$SITE_URL"

RUN yarn build

FROM nginx:stable-alpine3.17-slim AS runtime
Expand Down

0 comments on commit 92eb7ce

Please sign in to comment.