Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Version Control System » How to Deploy GitHub Repositories to cPanel using GitHub Actions
  • Dockerize NodeJS Application
    Dockerizing a NodeJs Express Application Automation
  • zabbix
    Monitoring services using Zabbix Linux
  • Featured image multi monitor
    Enhanced Multi-Monitor Experience with Windows 11 Windows
  • Screenshot 2022 04 02 at 22.17.10
    How to Install Kubectl on Windows 11 Windows
  • zoom
    How to update Zoom Desktop Client on macOS Mac
  • sql 1
    Editions of MSSQL Server: What are the differences between various Editions of Microsoft SQL Server Oracle/MSSQL/MySQL
  • discorddd
    Discord Installation Guide for Linux System Linux
  • Configure Data Deduplication on Windows Server
    Video on how to Configure Data Deduplication on Windows Server Windows Server

How to Deploy GitHub Repositories to cPanel using GitHub Actions

Posted on 27/06/202317/09/2024 Temitope Odemo By Temitope Odemo No Comments on How to Deploy GitHub Repositories to cPanel using GitHub Actions
Banner

A cPanel is a platform where you manage your web hosting, and you will need to push your local code to the cPanel shared hosting environment. A GitHub action is a continuous integration and continuous delivery (CI/CD) platform where you can automate your build, test, and deployment pipeline. In this article, I will be showing you a step-by-step process on how to connect and deploy your local repository to the cPanel shared hosting using a GitHub action. Please see How to Install and Setup WordPress into a cPanel and Configure Your First WordPress Theme, Chef Automate: AWS Opsworks For Chef Automate, and how to install and configure an FTP server on Windows 10.

This integration will help your development project greatly, you will be using a GitHub version control and each time you make a push to GitHub, it gets automatically deployed to your cPanel shared hosting.

Please see the YouTube video on how to Deploy GitHub Repositories to cPanel using GitHub Actions.

You can also read about how you can Set Up a Continuous Deployment Pipeline Using AWS CodePipeline and how to use Command-Line on Git Bash and GitHub Desktop to PUSH local code to GitHub.

Integrate Panel to GitHub Action

1. Setup an FTP account on cPanel

Login to your cPanel and navigate to FTP

FTP-Setup

2. Enter the details and create the FTP account

Add-FTP-Account

ftp account successfully created. Save your ftp account username and password because it Will be used with the hosting IP Address later.

FTP-Accounts-Created

3. Setup your local GitHub Repository

I want to believe you have already set up your local GitHub repository. But if not you can check How to use GitHub Desktop to PUSH local code to GitHub.

pushing-code-to-github

4. Add GitHub Secrets to your repository.

Open your local repository on GitHub. Click SETTINGS and navigate to SECRETS > ACTIONS.

Github-secrets

5. Click on New Repository Secret and add the Name and Secret value.

The value is the FTP username and password you created earlier.

Setting-actions-secrets-and-variables

Click on Add Secret. You will see the secret added successfully.

Repository-Secret

Also, see how to install Let’s Encrypt Wildcard SSL Certificate in cPanel using Certify The Web, and how to Disable Touchpad on Windows 11

6. Set up GitHub Actions Workflow for Deployment

Inside the GitHub repository, click on the ACTIONS tab and skip the suggested workflow but click on Set up a workflow yourself.

Setting-up-Github-action

You can edit the YAML file and change its name. but for the purpose of this guide, I am leaving the name as main.yml.

Now write the configuration code below into the file section: Enter your actual server’s name. Then enter secrets.ftp_username and secrets.ftp_password which will sync with the username and password we earlier defined under Secrets and variables.

Deployment-Workflow-Code

You can decide to change the branch if you want it to be set up for other branches.

Click on Commit Change which will now create a new workflow directory and place the configuration code in it. So, each time you push to the main branch or any other branch you set up, it will automatically deploy to the cPanel.

Each time you commit your code you can go to the Actions tab and check the progress status whether it’s running, successfully deployed, or there is a failed deployment.

All-Workflows-run-successfully

When you check your cPanel File Manager you will see the code has been deployed and it gets updated on every push from your local repository. That is all that it takes on how to Deploy GitHub Repo to cPanel using GitHub Actions

cPanel File Manager Image

Code-deployed-to-cPanel-file-manager

I hope you found this blog post on how to Connect and Deploy Local GitHub Repositories to cPanel Shared Hosting using GitHub Actions Interesting and helpful. In case you have any questions do not hesitate to ask in the comment section.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Automation, Version Control System Tags:deployment, FTP, Git, Git Bash, Git Clone, Git Commands, Git GUI, Github, Website

Post navigation

Previous Post: Build a Scalable VPC for Your AWS Environment [Part 1]
Next Post: How to install Windows Subsystem for Linux on Windows Server

Related Posts

  • header picture 1
    Azure CI/CD: Configuring Email Notifications in Azure DevOps AWS/Azure/OpenShift
  • Error during connect in the default daemon configuration on Windows
    Preparation failed: The docker client must be run with elevated privileges Version Control System
  • Dockerize NodeJS Application
    Dockerizing a NodeJs Express Application Automation
  • commit trong git 640
    How to uninstall Git from MacOS Mac
  • banner
    How to Import Data from a GitHub Repository to Postman Backup
  • Screenshot 2022 03 20 at 21.08.50
    How to integrate AWS CodeBuild and AWS CodeCommit to SonarCloud AWS/Azure/OpenShift

More Related Articles

header picture 1 Azure CI/CD: Configuring Email Notifications in Azure DevOps AWS/Azure/OpenShift
Error during connect in the default daemon configuration on Windows Preparation failed: The docker client must be run with elevated privileges Version Control System
Dockerize NodeJS Application Dockerizing a NodeJs Express Application Automation
commit trong git 640 How to uninstall Git from MacOS Mac
banner How to Import Data from a GitHub Repository to Postman Backup
Screenshot 2022 03 20 at 21.08.50 How to integrate AWS CodeBuild and AWS CodeCommit to SonarCloud AWS/Azure/OpenShift

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • Dockerize NodeJS Application
    Dockerizing a NodeJs Express Application Automation
  • zabbix
    Monitoring services using Zabbix Linux
  • Featured image multi monitor
    Enhanced Multi-Monitor Experience with Windows 11 Windows
  • Screenshot 2022 04 02 at 22.17.10
    How to Install Kubectl on Windows 11 Windows
  • zoom
    How to update Zoom Desktop Client on macOS Mac
  • sql 1
    Editions of MSSQL Server: What are the differences between various Editions of Microsoft SQL Server Oracle/MSSQL/MySQL
  • discorddd
    Discord Installation Guide for Linux System Linux
  • Configure Data Deduplication on Windows Server
    Video on how to Configure Data Deduplication on Windows Server Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,839 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.