# Github Action Workflow and environment variable

**URL:** <https://forum.elixirforum.com/t/github-action-workflow-and-environment-variable/48457>\
**Category:** Questions\
**Tags:** deployment, github-actions\
**Created:** [June 19, 2022, 7:50am UTC](https://forum.elixirforum.com/t/github-action-workflow-and-environment-variable/48457 "2022-06-19T07:50:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![msimonborg](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/msimonborg/32/26638_2.png) [@msimonborg](https://forum.elixirforum.com/u/msimonborg)\
**Post date:** [June 19, 2022, 8:12am UTC](https://forum.elixirforum.com/t/github-action-workflow-and-environment-variable/48457/2 "2022-06-19T08:12:11Z")

</div>

If you do not want to hardcode the values into the Dockerfile but instead want to set them from your environment, then to make them available to the builder try setting the build args at the command line with the `--build-arg` option and declaring them in the Dockerfile with `ARG`:

```elixir
# in Dockerfile
ARG ENV_VAR1
ARG ENV_VAR2
ENV ENV_VAR1=${ENV_VAR1}
ENV ENV_VAR2=${ENV_VAR2}

# in terminal
$ docker build --build-arg ENV_VAR1=${ENV_VAR1} --build-arg ENV_VAR2=${ENV_VAR2} .

```

> **[docker image build](https://docs.docker.com/reference/cli/docker/image/build/)**

---

_[View the full topic](https://forum.elixirforum.com/t/github-action-workflow-and-environment-variable/48457)._
