HubDocs

Guides / Deploy

Deploy from GitHub

Deploy public or private GitHub code and opt in to automatic deployments.

View Markdown

Connect your repository

After signing in, run:

CLI
hub deploy --git owner/repository

Public repositories clone anonymously; no GitHub grant is needed to deploy them. Private repositories require a grant to read the code. Approve access using the installation link if prompted.

Hub deploys the default branch, uses the repository name for the app, and prints its URL once the release is running. Open it to check the app. Repository visibility does not change app access: new apps are accessible to your organization.

New GitHub sources deploy once, with watching off. To publish another commit manually, push it to GitHub and run the same command again. Omitting the watch option preserves the setting when redeploying the same repository. Connecting a replacement repository defaults watching to off unless you explicitly enable it.

Deploy on every push

Opt in to watching:

CLI
hub deploy --git owner/repository --watch

Watching requires a GitHub grant for push-to-deploy webhooks, even for a public repository. The connection message explains whether access is needed for webhooks or because the repository is private or does not exist.

To turn watching off during a deployment, use hub deploy --git owner/repository --no-watch. To change an existing connection without deploying, use hub app repository git --watch off (replace repository with your app name). Turning watching off does not remove the read grant required for private code.

Publish changes

With watching enabled, push a commit to the connected branch. Hub builds and deploys it automatically. Check the result in the app's Releases tab in Cloud Dashboard.

Hub does not wait for external CI checks. Use required pull-request checks on your production branch.

If a build fails, read its build log, fix the source, and push again. The previous release keeps serving after a failed build.

When AI assistance is enabled and your organization has allowance remaining, Hub's AI agent can investigate and open a pull request with a suggested fix. Review and merge it to deploy the change.

Choose a branch or monorepo folder · Manage the connection · Create staging

On this page