Skip to main content

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.
This is the easiest and preferred method. Connect your GitHub account once and select repositories for each app.
1

Connect GitHub Account

Go to Shard Cloud Dashboard and navigate to ConfigIntegrations. Click “Connect with GitHub” and authorize Shard Cloud to access your repositories.
2

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.
3

Done!

Everything else is handled automatically by our backend. Push to your connected branch and your app will redeploy.
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.
1

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).
2

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.
3

Configure GitHub Webhook

Go to your repository on GitHub and navigate to SettingsWebhooks. 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”.
4

Test the Integration

Make a change to your code, commit, and push to the main or master branch. Your application should automatically redeploy.
Automatic deployments only trigger on pushes to the main or master branch.

Monitoring Deployments

After each push:
  1. Go to your application in the Shard Cloud dashboard
  2. Check the Deployments or Logs section
  3. 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

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.
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).
Check the deployment logs in Shard Cloud. Ensure your .shardcloud config is valid. Verify all required files are in the repository.
Generate a new token and update it in Shard Cloud. Consider using tokens without expiration.