# Using a flox environment for a GitHub build

**URL:** https://discourse.flox.dev/t/using-a-flox-environment-for-a-github-build/1053
**Category:** Help
**Created:** [January 13, 2025, 3:45pm UTC](https://discourse.flox.dev/t/using-a-flox-environment-for-a-github-build/1053 "2025-01-13T15:45:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![t0rx](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/t0rx/32/705_2.png) [@t0rx](https://discourse.flox.dev/u/t0rx)
#### Post date: [January 13, 2025, 3:45pm UTC](https://discourse.flox.dev/t/using-a-flox-environment-for-a-github-build/1053/1 "2025-01-13T15:45:00Z")

</div>

Is there a simple example of doing a CI build on GitHub in a Flox environment (defined in .flox in the repo), so the GitHub build is using exactly the same dependencies as the developers?

---

<div class="post-metadata">

### Author: ![t0rx](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/t0rx/32/705_2.png) [@t0rx](https://discourse.flox.dev/u/t0rx)
#### Post date: [January 13, 2025, 3:46pm UTC](https://discourse.flox.dev/t/using-a-flox-environment-for-a-github-build/1053/2 "2025-01-13T15:46:30Z")

</div>

I found [install-flox-action](https://github.com/flox/install-flox-action), but the example there looks to be building a Nix package rather than a normal build (e.g. via `npm build`).

---

<div class="post-metadata">

### Author: ![tomberek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/tomberek/32/83_2.png) [@tomberek](https://discourse.flox.dev/u/tomberek)
#### Post date: [January 13, 2025, 7:30pm UTC](https://discourse.flox.dev/t/using-a-flox-environment-for-a-github-build/1053/3 "2025-01-13T19:30:58Z")

</div>

That action gives you flox and Nix ready to use however you want. (Note: it does not activate your env for you.) If your env is committed to your repo, one might do something like `flox activate -- npm build`.

If you have an environment defined, you can also take a look [GitHub - flox/activate-action: Run command in a Flox environment](https://github.com/flox/activate-action) which will activate the env for you and you only need to run your `npm build`.

---

<div class="post-metadata">

### Author: ![t0rx](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/t0rx/32/705_2.png) [@t0rx](https://discourse.flox.dev/u/t0rx)
#### Post date: [January 14, 2025, 6:51pm UTC](https://discourse.flox.dev/t/using-a-flox-environment-for-a-github-build/1053/4 "2025-01-14T18:51:51Z")

</div>

Worked like a dream, thank you!
