System Environment set from github actions

Hello,

I have following configuration:

deploy.yml

  - name: Launch app
    if: env.APP_EXISTS == 'false'
    run: |
      flyctl launch \
        --no-deploy \
        --remote-only \
        --copy-config \
        --name $APP_NAME \
        --org $ORG_NAME \
        --region "fra" \
        --dockerfile ./Dockerfile \
        --build-arg PREVIEW=true

then in my Dockerfile I have following:

ARG PREVIEW=false
.... more code ....

# set build ENV
ENV MIX_ENV="prod"
ENV PREVIEW=${PREVIEW}

# install mix dependencies
COPY mix.exs mix.lock ./
RUN mix deps.get --only $MIX_ENV
RUN mkdir config
.... more code

# set runner ENV
ENV MIX_ENV="prod"
ENV PREVIEW=${PREVIEW}

# Only copy the final release from the build stage
COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/nexus ./

But always, after my pipeline runs, System.get_env(“PREVIEW”) has value “”. Anyone has any idea why?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.