Showing posts with label Web Hosting. Show all posts
Showing posts with label Web Hosting. Show all posts

How To Deploy Private GitHub Repository To Any Hosting - CI/CD

Github to webhosting, automatic deployment, ci/cd deployment

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
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.
 
Create an FTP account

2
. In FTP Accounts, click on Configuration FTP Client, to get FTP Username and FTP Server Address.

FTP Accounts Details


3. Now go to your repository Settings > Secrets > Actions and click on New repository secret.
Now go to your repository Secrets > Actions and click on New repository secret

4. Now add a repository secret these details one by one.
Name: FTP_SERVER
Value: YOUR_FTP_SERVER_ADDRESS

Name: FTP_USERNAME
Value: YOU_FTP_USERNAME

Name: FTP_PASSWORD
Value: YOUR_FTP_PASSWORD
In my case its
Name: FTP_SERVER
Value: ftp.recmail.net

Name: FTP_USERNAME
Value: admin_github@blog.hit4visit.com

Name: FTP_PASSWORD
Value: s^E7tXj+O00U
Add a repository secret

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.
workflow commit


Version 1 code:

name: Publish Website to Web Hosting
on:
  push:
    branches:
      - main
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2.1.0
      with:
        fetch-depth: 2
    - name: FTP-Deploy-Action
      uses: SamKirkland/FTP-Deploy-Action@3.1.1
      with:
        ftp-server: ${{ secrets.FTP_SERVER }}
        ftp-username: ${{ secrets.FTP_USERNAME }}
        ftp-password: ${{ secrets.FTP_PASSWORD }}

Version 2 code:

name: Publish Website to Web Hosting V2
on:
  push:
    branches:
      - main
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/checkout@v2

    - name: 📂 Sync files
      uses: SamKirkland/FTP-Deploy-Action@4.3.0
      with:
        server: ${{ secrets.FTP_SERVER }}
        username: ${{ secrets.FTP_USERNAME }}
        password: ${{ secrets.FTP_PASSWORD }}
And boom, now you can do CI/CD of your project. Now, wait a few minutes until it deploys its initial code, after that once you push to the branch your setup, for older "master" or new version "main" or whatever you setup as default or you want its push to be updated, it will automatically update on your website. 

Video Tutorial


Get best free hosting 10gb space and 100gb bandwidth

Global free hosters is one of the best free web hosting provider. Many of my friends using that too. So i taught why not suggested to my blog lovers? So friends don't need to go to any place. I have make a free hosting for to host your blogs/forums/websites as well as eComrance sites. Safe and secure.

This hosting have very special features. May be updated latter much better than this too? But present features are below.



Core Features Results
Price or any hidden costs? FREE
No ads! YES
Bandwidth 100GB
Disk space 10GB
FTP accounts 5
Addon domains Unlimited
Email accounts 5
MySQL database 5
Free Subdomains 5
Parked domain 5
Free Professional Web Design Templates YES
Free Easiest Website builder & Publisher YES
No contracts! YES
Free / Instant setup YES
Knowledge Base & FAQ YES
Help Center & Support YES
Weekly backups YES
99.9% Uptime YES
Short Free Subdomains Coming Soon
Support International Domain names YES

Technical Server Features Results
PHP 5 YES
MySQL 5 Database Server YES
FTP Access YES
2 Web File Managers YES
cURL YES
Custom Cron jobs YES
Web SSH console YES
.htaccess support YES
GD YES
Hotlinking protection YES
Hotlinking protection YES
ionCube Loaders v3.3.20 YES
Zend Optimizer v3.3.9 YES
E-mail Hosting features Results
POP3 Accounts YES
WebMail Access (RoundCube, SquirellMail) YES
E-mail alias YES
Mail forwarding features YES
Spam Assasin Protection YES
IMAP Support YES

Free Hosting cPanel & scripts Results
Latest GlobalFreeHosters.com cPanel YES
PhpMyAdmin YES
IP deny Manager YES
Fantastico 1 click Web site Installer YES
Instant Blogs YES
Instant PHPnuke YES
Instant Portals YES
Instant Forums YES
Instant Guestbook YES
Instant counter YES
Redirect URL YES
Password protected directories YES
Instant FormMail YES
E-Commerce features Results
osCommerce one click install YES
CubeCart one click install YES
ZenCart one click install YES
BoxBilling one click install YES
Free SEO tools, Search Engine submitter YES

Multimedia features Results
DHTML Support YES
Flash Support YES
Streaming Audio / Video YES
Real Audio and Video support YES
Shockwave Support YES
MIDI File Support YES
Javascript Support YES
Add custom MIME Types YES
World class Hosting Technologies Results
Dual Quad Processor Performance YES
Multiple 10 Gigabit Ethernet Connections YES
Linux Operating System YES
Linux Operating System YES
UPS Power Backup YES
Diesel Generator Backup Power YES
Courtesy Site Backups YES
24/7 Network Monitoring YES
24/7 Network Monitoring YES



Join this great site now www.globalfreehosters.com