How To Deploy Private GitHub Repository To Any Hosting - CI/CD
GitHub to Web Hosting
You can deploy private GitHub repo to cPanel, Hostinger, or any Web Hosting Manager. Automatic deployment for your CI/CD. This method will work for that. I'm a web developer by profession, I face this issue a lot until I find this method.
Deploying while cPanel Git version control you will face the issue "GitHub cannot access private repository" while submitting Github private repo unless until you setup a private key of cPanel to your GitHub Deploy keys.
Here you don't need to have SSH access or any root access for this method. All you need is an FTP ACCOUNT.
Let's start
In this method, I will be using the Deployment of GitHub Private Repo to cPanel.
1. You have to create an FTP account.
You need to setup the following details.
Log In: it will be the username
Log In: it will be the username
Domain: it will be your domain name.
Password: Write a password whatever you like. But keep it safe we will use re-use it, in github.
3. Now go to your repository Settings > Secrets > Actions and click on New repository secret.
Name: FTP_SERVERValue: YOUR_FTP_SERVER_ADDRESSName: FTP_USERNAMEValue: YOU_FTP_USERNAMEName: FTP_PASSWORDValue: YOUR_FTP_PASSWORD
In my case its
Name: FTP_SERVERValue: ftp.recmail.netName: FTP_USERNAMEValue: admin_github@blog.hit4visit.comName: FTP_PASSWORDValue: s^E7tXj+O00U
5. Now add an action workflow. Change its name from main.yml to cPanelDepolyment.yml
Copy the code below and add it to the workflow, click on start commit and then commit new file.






Comments
Post a Comment