Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redeploy Heroku app without code changes

Tags:

heroku

People also ask

How do I make heroku again?

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.

How do I deploy heroku with an existing Git repository?

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.

Can we deploy on heroku without git?

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!

  1. Login to your Heroku dashboard and go to deploy section
  2. Find Manual deploy option

Hit Deploy Branch button!

enter image description here

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.