Getting started
Connect GitHub and deploy a repository
Connect your GitHub account to DployHub to deploy public or private repositories, pick a branch and get automatic deploys to staging on every push.
Updated 3 min read
GitHub is the most convenient way to deploy on DployHub. Once your account is connected you can pick any repository you have access to, including private ones, and every push to the chosen branch can build and deploy automatically to staging.
Connect your GitHub account
- 1
Start a new app
Go to Apps, then New app (/portal/apps/new).
- 2
Choose GitHub as the source
Select GitHub and click Connect your GitHub account. You are sent to GitHub to approve access and then returned to the form.
- 3
Pick a repository and branch
Choose the repository from the list and the branch you want to deploy, for example
main. Pushes to this branch trigger deploys. - 4
Finish the app
Leave "Figure it out for me" selected or pick a build type, name the app, choose resources and create it.
How auto-deploy works
When you create an app from GitHub we register a push webhook on the repository. Each push to the app branch starts a build and deploys the result to staging. The commit hash and commit message are recorded with the deployment, so the Deployments tab shows exactly which change is running.
Auto-deploy is on by default for GitHub apps. You can switch it off in the app Settings if you prefer to deploy manually with the Deploy button. If you want every successful staging deploy to reach live without pressing Go live, turn on auto go-live in Settings.
Monorepos and subfolders
If the app lives in a subfolder of the repository, set Folder with your app to that path, for example apps/web. Detection, the build and the Dockerfile path are all relative to that folder. See Build settings for every field.
A typical workflow
- Work on a feature branch and open a pull request as usual.
- Merge into the app branch. The push triggers a build and a staging deploy.
- Open the staging address and check the change.
- Press Go live. The exact image from staging is promoted to live in seconds, with no rebuild.
Troubleshooting
- Repository missing from the list: make sure the connected GitHub account can access it.
- Push did not deploy: check that the push was to the app branch and that auto-deploy is on in Settings.
- Build failed after a push: open the deployment in the Deployments tab to read the build log, then see Build failed.
Still stuck? Raise a ticket and attach the app and the deployment so we see the status and recent logs straight away.
Frequently asked questions
Can I deploy a private GitHub repository?
Yes. Connect your GitHub account when creating the app and private repositories you can access appear in the list.
Where do push deploys go?
A push to the app branch builds and deploys to staging. Press Go live, or turn on auto go-live, to promote it to live.
Can I turn off automatic deploys?
Yes. Switch off auto-deploy in the app Settings and use the Deploy button whenever you want a new build.
Related articles
- Auto-deploy on every git push from GitHubTurn on auto-deploy so every push to your GitHub branch builds and deploys to staging on DployHub, with the commit recorded for each deploy.
- Deploy your first app on DployHubA step-by-step guide to deploying your first app on DployHub: pick a source, let us detect the build, choose resources and get a live HTTPS address.
- Staging and live environments: test, then go liveEvery DployHub app has a free staging environment and a live one. Learn how deploys flow through staging and how Go live promotes the same image.
- Build settings: build, start, root folder and moreEvery DployHub build setting explained: build type, build and start commands, port, root folder, Dockerfile path and health check path, with examples.