How to deploy your GitHub repositories to cPanel the easier way.

To use or do anything in Git, you need repositories, either on your local computer or one hosted on your GitHub, GitLab or bitbucket account.

Do you wish to deploy these repositories on your live server via cPanel?

Have you been using the manual method of downloading your repositories from GitHub, GitLab or Bitbucket, then uploading manually via the cPanel file manager tool?

If the answer is YES, then this is for you, I will show you how you can deploy your repositories to cPanel automatically with some simple steps.

If you have the appropriate permissions, you can host a local git repository with an online remote repository (Github / bitbucket etc) on a cPanel account.

Image for post
Git to Cpanel

A refresher; Git is an open-source Version Control System(VCS) that tracks contents (files and directories) histories and versions, It manages changes to a project without overwriting any part of the project. It allows developers to collaborate and work on a project simultaneously.

So, How do you deploy your git repositories on cPanel?

The following steps help you deploy and manage your projects with ease.

On your Local machine (Using your preferred text editor)

· Add a .cpanel.yml file into the root folder of your repository and

Image for post
Add a .cpanel.yml file

· Add the following to the .cpanel.yml

Replace “cpanelUser” with your cpanel username.

· Git Add, commit and push these changes to github.

On your cPanel account

· Log into cPanel

· Select Git Version Control under Files

· Click on CREATE

Image for post

· Copy the git clone URL into the Clone URL

Image for post

· Copy the git clone link

Image for post

· Fill in a file path for the repository (remember the cloned repository provides its own directory)

Image for post

· Fill in a name for the repository as it will appear in your cPanel interface

· Click Create

· In front of the newly created repository, click on “MANAGE

Image for post

· Click on “UPDATE FROM REMOTE”, this will get the latest version of the repository from github or gitlab etc.

Image for post

· You will get a success message if the repo is fecthed successfully.

Image for post

· Click on “DEPLOY HEAD COMMIT”, This command pushes your revisions to the copy of the repository that exists on your cPanel account.

· You will get a SUCCESS MESSAGE, if it successfully deployed.

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *

PAGE TOP
error

Enjoy this blog? Please spread the word :)

RSS
Follow by Email