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

  1. Open the site detail → Git tab (or Deployment tab).
  2. Set the following fields:
FieldDescription
Repository URLThe SSH or HTTPS URL of your git repo (e.g., git@github.com:user/repo.git)
BranchThe branch to deploy (e.g., main, production)
Deploy keySSH key for CloudAIPilot to clone the repo (auto-generated — copy and add to your git provider)
  1. 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:

  1. Go to your repo → Settings → Deploy keys → Add deploy key.
  2. Paste the public key CloudAIPilot generated.
  3. Check "Allow read access" (read-only is sufficient).
  4. Click "Add key".

GitLab:

  1. Go to your repo → Settings → Repository → Deploy keys.
  2. Paste the key, give it a title, enable Read-only.

Step 3: Register the Webhook in Your Git Provider

  1. In CloudAIPilot, copy the Webhook URL shown on the Git tab.
  2. 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 push event
  • Secret: paste the webhook secret shown in CloudAIPilot
  1. Save the webhook.

Step 4: Test the Connection

  1. In CloudAIPilot, click Test Connection on the Git tab.
  2. CloudAIPilot clones the repo to verify the deploy key works.
  3. If successful, you will see a confirmation message.

How Auto-Deploy Works

When you push to the configured branch:

  1. Your git provider sends a POST to the CloudAIPilot webhook URL.
  2. CloudAIPilot verifies the webhook signature using the shared secret.
  3. A new deployment plan is created and immediately queued (autoConfirm: true).
  4. The server runs: git pull origin + any post-deploy hooks (reload Nginx, restart services).
  5. Progress is visible in the Activity Center.

Manual Deploy Trigger

To deploy without a git push:

  1. Open the site detail → Git tab.
  2. Click Deploy Now.
  3. 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

IssueLikely causeFix
Webhook not firingIncorrect webhook URLRe-copy the webhook URL from CloudAIPilot and replace it in the git provider.
"Permission denied (publickey)"Deploy key not added to git providerAdd the deploy key from CloudAIPilot to your repo's deploy keys.
Deployment triggered but fails at git pullWrong branch nameVerify the branch exists in the remote repo. Check spelling.
Webhook fires but CloudAIPilot ignores itSignature mismatchRe-copy the webhook secret from CloudAIPilot and update it in your git provider.

Related Articles