Git Settings and Webhook Deploy
Who this is for
Users who want to deploy their site automatically when they push code to a git repository, or who want to configure which branch CloudAIPilot deploys.
Prerequisites
- Site already created in CloudAIPilot.
- You have a git repository (GitHub, GitLab, Bitbucket, or any git host) with your site's code.
- The server has SSH access and the git provider is reachable from the server.
Overview
CloudAIPilot supports webhook-triggered deployments: when you push to a configured branch, your git provider sends a webhook notification to CloudAIPilot, which then triggers a deployment plan on the server.
Step 1: Configure Git Settings on the Site
- Open the site detail → Git tab (or Deployment tab).
- Set the following fields:
| Field | Description |
|---|---|
| Repository URL | The SSH or HTTPS URL of your git repo (e.g., git@github.com:user/repo.git) |
| Branch | The branch to deploy (e.g., main, production) |
| Deploy key | SSH key for CloudAIPilot to clone the repo (auto-generated — copy and add to your git provider) |
- Click Save Git Settings.
Step 2: Add the Deploy Key to Your Git Provider
CloudAIPilot generates a read-only deploy key (SSH public key) for the site. Add this key to your git repository:
GitHub:
- Go to your repo → Settings → Deploy keys → Add deploy key.
- Paste the public key CloudAIPilot generated.
- Check "Allow read access" (read-only is sufficient).
- Click "Add key".
GitLab:
- Go to your repo → Settings → Repository → Deploy keys.
- Paste the key, give it a title, enable Read-only.
Step 3: Register the Webhook in Your Git Provider
- In CloudAIPilot, copy the Webhook URL shown on the Git tab.
- In your git provider, add a new webhook:
- GitHub: repo Settings → Webhooks → Add webhook
- URL: paste the CloudAIPilot webhook URL
- Content type:
application/json - Events: Just the
pushevent - Secret: paste the webhook secret shown in CloudAIPilot
- Save the webhook.
Step 4: Test the Connection
- In CloudAIPilot, click Test Connection on the Git tab.
- CloudAIPilot clones the repo to verify the deploy key works.
- If successful, you will see a confirmation message.
How Auto-Deploy Works
When you push to the configured branch:
- Your git provider sends a POST to the CloudAIPilot webhook URL.
- CloudAIPilot verifies the webhook signature using the shared secret.
- A new deployment plan is created and immediately queued (autoConfirm: true).
- The server runs:
git pull origin+ any post-deploy hooks (reload Nginx, restart services). - Progress is visible in the Activity Center.
Manual Deploy Trigger
To deploy without a git push:
- Open the site detail → Git tab.
- Click Deploy Now.
- This triggers the same deployment plan manually.
Post-Deploy Hooks
Some app types run additional steps after git pull:
- WordPress:
wp cache flush(if WP-CLI is available) - Node.js:
npm install,npm run build - Composer-based apps:
composer install
Post-deploy hooks are configurable in the Git tab.
What Success Looks Like
Pushing to the configured branch triggers a deployment visible in the Activity Center. The plan completes successfully. The live site shows the changes from the push.
Common Issues and Fixes
| Issue | Likely cause | Fix |
|---|---|---|
| Webhook not firing | Incorrect webhook URL | Re-copy the webhook URL from CloudAIPilot and replace it in the git provider. |
| "Permission denied (publickey)" | Deploy key not added to git provider | Add the deploy key from CloudAIPilot to your repo's deploy keys. |
| Deployment triggered but fails at git pull | Wrong branch name | Verify the branch exists in the remote repo. Check spelling. |
| Webhook fires but CloudAIPilot ignores it | Signature mismatch | Re-copy the webhook secret from CloudAIPilot and update it in your git provider. |