Using Git allows you to manage your code versions and easily deploy updates to your BurjHost server. Here are several methods to connect your Git repository.
Method 1: Clone via SSH (For VPS/Advanced Users)
-
Log in via SSH to your server.
-
Navigate to your web directory:
cd ~/public_html -
Clone your repository:
git clone https://github.com/username/repository.git .
(The dot clones into the current directory. Omit it to clone into a subfolder). -
Set up a deploy hook or simply
git pullto update.
Method 2: Using cPanel's Git Version Control
Many BurjHost cPanel installations include a "Git Version Control" interface.
-
Log in to cPanel.
-
In the "Files" section, click "Git Version Control."
-
Click "Create" or "Add Repository."
-
Enter Repository Details:
-
Clone URL: Your Git repository URL (HTTPS or SSH).
-
Repository Path: The directory where you want to clone (e.g.,
public_html). -
Branch: Specify the branch to deploy (e.g.,
mainormaster).
-
-
Click "Create."
-
You can now "Pull" or "Deploy" updates directly from cPanel.
Method 3: Automated Deployments with GitHub Actions (Advanced)
Set up a CI/CD pipeline to automatically deploy when you push to GitHub.
-
Create a GitHub Actions workflow file (
.github/workflows/deploy.yml). -
Use FTP or SSH commands to sync files to your server on push events.
Example GitHub Action snippet (FTP deployment):
- name: Deploy to Server uses: SamKirkland/FTP-Deploy-Action@4.3.0 with: server: ${{ secrets.FTP_SERVER }} username: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} local-dir: ./ server-dir: /public_html/