DEV Community

Discussion on: How to setup CI with Phoenix & Github Actions

noelworden profile image
Noel Worden

This was super helpful! I had my CI already setup, but it broke when I made changes to the test.exs config to get my tests to run in the containers. After digging around I had this in the config file:

if System.get_env("GITHUB_ACTIONS") do
   config :my_app, MyApp.Repo, hostname: "db"

But I like how you handled it with:

hostname: System.get_env("DB_HOST") || "localhost"

I saw your ElixirConf talk, so I think it's just that much better that I ran across this post and it helped me write better code.