- “Build client side assets heroku”
- “Run gulp after deploy heroku”
were surprisingly unhelpful, unless you were actually running a nodejs application.
So I’m a noob with Heroku - I admit that. Heroku is generally very good for noobs and it was still a little hard to figure out. I ended up making the assumption that the instructions for nodejs would also work in other applications, crucially
- Add the ‘nodejs’ buildpack to your app, along with whatever else (e.g. PHP)
- Heroku will run npm install if you have a package.json in your app root
- Heroku will run the “postinstall” script in your “scripts” block in package.json if it is there
Adding environment variables was easy to figure out so I added one for the app. The gulpfile can access those (even in postinstall). I wrote the gulpfile and after a few silly mistakes saw my assets getting built correctly after deploy.