How to Automatically deploy from GitHub (Git) to cPanel Print

  • 0

This tutorial provides a quick way of deploying files from GitHub to cPanel. We are only deploying from GitHub; thus making GitHub our single source of truth. In other words, we will be pulling from GitHub.

cPanel is an online Linux-based graphical user interface (GUI) used as a control panel to simplify website and server management. cPanel allows you to publish websites, manage domains, organize web files, create email accounts, and even more. cPanel is one of the popular control panels.

In this tutorial, I shall walk you through configuring and setting up your Git repo and have it auto deploy to cPanel. Let's get started. First, you need to login into cPanel.

Login in into cPanel

To login to cPanel, on your browser, navigate to https://cpanel.yoursite.com or https://yoursite.com:2083.

1. Navigate to Git Version Control

To navigate to Git Version Control, follow cPanel > Home > File > Git Version Control. The GVC allows you to configure deployment for your cPanel-managed repositories.

Navigate to Git Version Control

2. See or Link your Repositories

The next screen that you will see will enable you manage your repositories. I have a repository already linked from GitHub to cPanel. If you currently do not have any repo linked, then go ahead and click on "Create" .

If you already have a repo from Git link to your cPanel, please skip to Step 4

See or Link your Repositories

3. Clone your Repository

This step will enable you to clone your remote repo to cPanel. You should fill in the fields such as clone URLRepository Path.

  1. The Clone URL refers to your remote repository URL. It must begin with either http://https://ssh:// or git:// Examplehttps://github.com/starahost/exampleproject.git

  2. The Repository Path refers to directory where your repo will live on cPanel. The path is usually home/YOUR-USERNAME/REPOSITORY-NAME
    If everything looks good, go ahead and click on "Create"

Clone your Repository

4. Manage Repositories

This step will allow us manage our repositories which we have on cPanel. To navigate to Git Version Control, follow cPanel > Home > File > Git Version Control. The GVC allows you to configure deployment for your cPanel-managed repositories.

You will see a list of all repositories currently linked to cPanel from Git. Click on Manage to be taken to the next step.

Manage Repositories

5. Pull or Deploy

After having filled the fields for information about your repos in step 4 above, now is the time to clone your remote repo to cPanel just like how you would on your local machine


Was this answer helpful?

« Back