I started with...
... but apparently that blog post is outdated. Let's start over with:
$ heroku buildpacks:set https://github.com/gjaldon/phoenix-static-buildpack $ heroku buildpacks:add --index 1 https://github.com/HashNuke/heroku-buildpack-elixir
This puts the Elixir buildpack in the first position, and pushes the Phoenix Static build pack down to second. See this article on [using multiple buildpacks for an app] for more info.
Let's try to deploy and see what happens:
$ git push heroku master [...] remote: -----> Fetching app dependencies with mix remote: ** (Mix.Config.LoadError) could not load config config/prod.secret.exs
The file is present, but it is listed in .gitignore and so isn't pushed to Heroku. Let's comment out the import in config/prod.exs (last line). (git add && commit)
Trying again, we get a new and improved error message:
$ git push heroku master [...] remote: == Compilation error on file lib/phoenix_heroku_wsmoak/repo.ex == remote: ** (ArgumentError) missing :adapter configuration in config :phoenix_heroku_wsmoak, PhoenixHerokuWsmoak.Repo
And *that's* because the things in that file we didn't import *are* actually needed. But they aren't things you want to commit to your repository, for security reasons they need to be set in the environment.
So, copy the contents of config/prod.secret.exs into config/prod.exs, and then replace the sensitive values with (for example)
Next, set the corresponding environment variables in Heroku, for example:
heroku config:set DATABASE_PASSWORD=longsecretpassword
Finally, edit (create if necessary)
phoenix_static_buildpack.config in the root of your app and specify the environment variables to be exported.
Note that this *overrides* the one from https://github.com/gjaldon/heroku-buildpack-phoenix-static so make sure to include any values in that one, such as DATABASE_URL
My phoenix_static_buildpack.config file now includes:
config_vars_to_export=(DATABASE_URL SECRET_KEY_BASE DATABASE_USERNAME DATABASE_PASSWORD)
git add && commit these changes, and then `git push heroku master` again...
... and success! With stylesheets this time! https://evening-beach-7791.herokuapp.com
Thanks to ericmj, HashNuke, and chrismccord in #elixir-lang on freenode as well as gjaldon for the build pack.