I would like to deploy a Heroku app which will be done ideally using git push -u heroku master
. However this will only work if there are any pending commits to
Normally setting a config var causes your application to be restarted. In most situations there should be no need to redeploy after doing this.
If you really do need to trigger a new deployment you can add a new empty commit, then push to Heroku again:
git commit --allow-empty -m "Trigger Heroku deploy after enabling collectstatic"
git push heroku master
The new empty commit is a regular commit. It has a hash, an author, a timestamp, etc. It will have the same tree as its parent. This should cause Heroku to build your app slug again using the same code as the previous commit.
It's a bit awkward, but it works.
You can run heroku restart --app app_name
and you are good to go.
There is now also a plugin for the Heroku command-line that allows you to re-release the most recently deployed slug.
See https://www.npmjs.com/package/heroku-releases-retry
You can do it from UI as well!
Heroku
dashboard and go to deploy
sectionManual deploy
option Hit Deploy Branch
button!