How to Set Up Automatic Git Deployment (CI/CD) with cPanel

Automating your deployment pipeline means every push to your GitHub repository can trigger an update on your dotCanada server - no manual steps required. Here's how to set it up using cPanel's Git Version Control and GitHub webhooks.

Step 1: Set Up Git Version Control in cPanel

Make sure your GitHub repository is already cloned in cPanel's Git Version Control. If not, follow our guide on connecting GitHub to cPanel first.

Step 2: Get the cPanel Git Webhook URL

  1. In cPanel, go to Git Version Control.
  2. Click Manage next to your repository.
  3. Go to the Pull or Deploy tab.
  4. You'll see a Deployment URL - copy it.

Step 3: Add the Webhook to GitHub

  1. Go to your GitHub repository Settings > Webhooks.
  2. Click Add webhook.
  3. Paste the cPanel deployment URL into the Payload URL field.
  4. Set Content type to application/json.
  5. Choose Just the push event and click Add webhook.

Step 4: Add a Deployment Script

Include a .cpanel.yml file in the root of your repository to define what happens on each deploy. For example, it can copy files to your public directory, run Composer, or clear a cache.

Testing the Pipeline

Push a change to your GitHub repository and check the webhook response. If successful, cPanel will pull the latest code and run your deployment script automatically.

If you need help configuring your CI/CD pipeline, contact our support team and we'll walk you through it.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today