You can run heroku restart --app app_name and you are good to go. @PanMan The question says "How can I redeploy the app while there is nothing to push ?". It's not asking for the app to rebuild but to restart, and given that there were no changes I don't see why you would want to anyway.
To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.
There is absolutely NO REASON that you have to use github to use Heroku. UPDATE2: Heroku have now introduced HTTP GIT - much simpler without having to deal with SSH keys and such like.
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 do it from UI as well!
Heroku
dashboard and go to deploy
sectionManual deploy
optionHit Deploy Branch
button!
Note: you must have your app connected to GitHub for this option to be available (see comment from Derek below).
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 run heroku restart --app app_name
and you are good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With