diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker.yml index 7559d57..133f72c 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker.yml @@ -13,7 +13,6 @@ on: env: IMAGE_NAME: ${{ github.event.repository.name }} - # set this SITE_URL: 'https://docker.nemanjamitic.com' jobs: @@ -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 diff --git a/docker/Dockerfile b/docker/Dockerfile index 6d5fe5b..af9fe8d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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