Skip to content

Deploying

Auto-deploy on every git push from GitHub

Turn on auto-deploy so every push to your GitHub branch builds and deploys to staging on DployHub, with the commit recorded for each deploy.

Updated 3 min read

Auto-deploy means you never have to click Deploy for routine changes. Push to your branch on GitHub and DployHub builds the new code and releases it to staging, usually before you have switched windows. It works for apps created from a connected GitHub repository.

How it works

When you create an app from GitHub, we register a push webhook on the repository. Every time you push to the branch the app is set to, GitHub notifies us and we start a deploy:

  1. We clone the pushed commit and record its hash and commit message.
  2. We build it using your build settings. Build logs stream live in the Deployments tab.
  3. We release the new version to staging with zero downtime. The old version keeps serving until the new one passes its health check.

Pushes to other branches are ignored. If you want to deploy a different branch, change the branch in the app settings.

Turn auto-deploy on or off

  1. 1

    Connect GitHub

    If you have not already, connect your GitHub account while creating an app. See Connect GitHub.

  2. 2

    Open the app Settings

    Open the app and go to Settings.

  3. 3

    Use the auto-deploy toggle

    Auto-deploy is on by default for GitHub apps. Switch it off if you would rather deploy manually with the Deploy button.

From staging to live

Pushes always go to staging first, so you can check the change at your staging address before customers see it. When you are happy, click Go live to promote the exact image running on staging to live, with no rebuild.

If you want every successful staging deploy to reach live without a click, turn on the auto go-live setting. Each push then builds, deploys to staging, and promotes to live once staging is healthy. A push that fails to build or start never reaches live, and the current live version keeps serving.

Git URL and Docker image apps

Apps created from a public Git URL or a Docker image do not have a webhook. Deploy them manually with the Deploy button whenever you want to pick up new code or a new image tag. If you want push-to-deploy for a Git URL app, create a new app from GitHub instead.

When a push does not deploy

  • Check that you pushed to the branch shown in the app settings.
  • Check that auto-deploy is switched on in Settings.
  • Open the Deployments tab. If a deploy started but failed, the build log and the last log lines tell you why. See Build failed.
  • If nothing appears at all after a push, deploy manually once and raise a ticket with the app attached.

Frequently asked questions

Does a push deploy straight to live?

No. Pushes deploy to staging. Click Go live, or turn on auto go-live to promote every successful staging deploy.

Can I auto-deploy from a public Git URL?

No. Only apps connected through GitHub get a push webhook. Use the Deploy button for Git URL and Docker image apps.

Which commit is running right now?

The Deployments tab lists each deploy with its commit hash, message, who triggered it and how long it took.