This is a minimal example for deploying an elm app with Heroku using the fantastic create-elm-app.
It uses the nodejs buildpack to provide create-elm-app
.
Installation of elm and building of the app is done using the inline buildpack.
The static buildpack is used to provide the app after building.
Just use the following button to deploy this example on Heroku.
Follow these steps to deploy this example on Heroku via Heroku CLI.
Clone this repository and add Heroku settings.
# Clone and browse repo
git clone https://github.com/chemmi/heroku-create-elm-app
cd heroku-create-elm-app
# Create heroku app
heroku create
# heroku create my-fancy-app-name
# Add buidpacks
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-nodejs.git
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-inline.git
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-static.git
Push to Heroku to deploy the app.
git push heroku master
This repo can be used as boilerplate for other projects. Just copy some files to your local project and follow the deployment steps.
cp -r app.json package.json static.json bin /path/to/your/elm-app
You may want to update the fields name
, description
and repository
in your copy of app.json
.
app.json is mainly used for config-as-code buildpacks and the deployment button.
package.json is used for the nodejs buildpack to provide create-elm-app
and node for subsequent build steps.
bin/* is used for the inline buildpack.
detect and release are more or less dummies.
compile does install elm and builds the application using elm-app build
.
static.json is used for the static buildpack to provide the application after building.
Thanks halfzebra for create-elm-app!
A different approach for deployment using Heroku via local build of the app is done by MainShayne233.
Boilerplates for the use of the inline buildpack are taken from JetThoughts.
The compile-part is mostly adapted from srid's elm buildpack.
- Add caching (binary, elm-stuff, ...)
- Add support for different elm versions (mind differet release formats!)