Introduction
Git integration allows you to automatically deploy your application whenever you push changes to your GitHub repository. Shard Cloud offers two methods to set this up.Method 1: GitHub Integration (Recommended)
This is the easiest and preferred method. Connect your GitHub account once and select repositories for each app.Connect GitHub Account
Go to Shard Cloud Dashboard and navigate to
Config → Integrations. Click “Connect with GitHub” and authorize
Shard Cloud to access your repositories.
Link Repository to Your App
Go to your application in the dashboard and navigate to the Deploys
section. Select the repository you want to connect and choose the branch to
deploy from.
This method is simpler because you don’t need to manage tokens or webhooks
manually. Shard Cloud handles everything for you.
Method 2: Manual Webhook Setup
If you prefer more control or need to use a personal access token, you can set up webhooks manually.Generate GitHub Access Token
Go to GitHub Personal Access Tokens
and click “Generate new token (classic)”. Configure the following: -
Note: Give it a descriptive name (e.g., “Shard Cloud Deploy”) -
Expiration: Set to “No expiration” to avoid interruptions - Scopes:
Select only “repo” (full control of private repositories) Click
“Generate token” and copy it immediately (you won’t see it again).
Configure Token in Shard Cloud
Go to Shard Cloud Dashboard and
select your application. Navigate to the Deploy section, paste your
GitHub token, and click Save. A webhook URL will be generated.
Copy this URL for the next step.
Configure GitHub Webhook
Go to your repository on GitHub and navigate to Settings → Webhooks.
Click “Add webhook” and configure: - Payload URL: Paste the webhook
URL from Shard Cloud - Content type:
application/json - Events:
Select “Just the push event” Click “Add webhook”.Automatic deployments only trigger on pushes to the
main or master branch.Monitoring Deployments
After each push:- Go to your application in the Shard Cloud dashboard
- Check the Deployments or Logs section
- Verify the deployment completed successfully
Best Practices
Use a Production Branch
Deploy from a stable branch like
main or master.Test Locally First
Always test changes locally before pushing.
Don't Commit Secrets
Use environment variables for sensitive data.
Monitor Deployments
Check deployment logs after each push.
Troubleshooting
GitHub integration not showing repositories
GitHub integration not showing repositories
Ensure you’ve authorized Shard Cloud to access your repositories. Try
disconnecting and reconnecting your GitHub account. Check that the
repository is not private without proper permissions.
Webhook not triggering
Webhook not triggering
Check that the webhook URL is correct. Verify the GitHub token has the
correct permissions. Look at webhook delivery logs in GitHub (Settings →
Webhooks → Recent Deliveries).
Deployment fails
Deployment fails
Check the deployment logs in Shard Cloud. Ensure your
.shardcloud config
is valid. Verify all required files are in the repository.Token expired
Token expired
Generate a new token and update it in Shard Cloud. Consider using tokens
without expiration.
