Skip to main content
DeployHub integrates deeply with GitHub to provide seamless authentication and repository access for both public and private repositories.

GitHub OAuth Flow

DeployHub uses GitHub OAuth 2.0 for secure authentication and repository access.

Authentication Scopes

Requested Scopes:
  • repo - Full access to public and private repositories
  • user:email - Read user email addresses
  • admin:repo_hook - Create and manage webhooks for auto-deployments
The admin:repo_hook scope enables automatic redeployment when you push changes to GitHub.

Login Endpoint

Redirects to GitHub’s authorization page where users grant permissions.

Callback Handler

After authorization, GitHub redirects back to DeployHub’s callback:

User Profile Creation

DeployHub creates or updates your user profile with GitHub data:
If you already have an account with the same email, DeployHub links your GitHub account to it.

Repository Access

Fetching User Repositories

DeployHub retrieves all repositories you have access to:
API Endpoint:
Response:

Private Repository Cloning

DeployHub uses stored GitHub access tokens to clone private repositories:
If you’re not authenticated with GitHub, DeployHub can still clone public repositories.

Commit SHA Tracking

DeployHub fetches the latest commit SHA to detect changes:
Build Model:
Commit SHA tracking enables intelligent redeployments - DeployHub only rebuilds when code changes.

Automatic Webhooks

After successful deployment, DeployHub automatically creates a GitHub webhook for continuous deployment:
Webhook Configuration:
  • Event: push (triggers on code push)
  • Payload URL: DeployHub webhook endpoint
  • Content Type: JSON
  • Secret: HMAC signature verification

Webhook Handler

The webhook handler processes GitHub push events:
Webhooks are only created for projects deployed by authenticated GitHub users. Public deployments won’t receive automatic updates.

Security Features

HMAC Signature Verification

All webhook requests are verified using HMAC-SHA256:

Token Storage

GitHub access tokens are securely stored in the database:
Access tokens are never exposed to the frontend or in API responses.

Branch Selection

You can deploy from any branch in your repository:
Update branch in project settings to deploy from a different branch.

Limitations

  • Maximum 100 repositories per request (paginated)
  • Webhooks created only on first deployment
  • Branch must exist when creating deployment
  • Token expires if you revoke GitHub access

Troubleshooting

”GitHub token missing”

You need to log in with GitHub to access private repositories:

“You are not logged in with github”

Your account was created with email/password. Connect GitHub from settings or create a new account.

Webhook not triggering

Check that:
  1. You deployed the project while authenticated with GitHub
  2. The webhook exists in your repository settings
  3. Your GitHub token hasn’t been revoked
  4. Pushes are to the default branch configured in settings