GitHub OAuth Flow
DeployHub uses GitHub OAuth 2.0 for secure authentication and repository access.Authentication Scopes
repo- Full access to public and private repositoriesuser:email- Read user email addressesadmin: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
Callback Handler
After authorization, GitHub redirects back to DeployHub’s callback:User Profile Creation
DeployHub creates or updates your user profile with GitHub data:Repository Access
Fetching User Repositories
DeployHub retrieves all repositories you have access to: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:Automatic Webhooks
After successful deployment, DeployHub automatically creates a GitHub webhook for continuous deployment:- 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: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:Limitations
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:- You deployed the project while authenticated with GitHub
- The webhook exists in your repository settings
- Your GitHub token hasn’t been revoked
- Pushes are to the default branch configured in settings