- Create a Git Repository as public visibility.
- Push your entire website code to your Git Repository.
- Open cPanel
- Go to GitTM Version Control
- Click on New button
- Enter your Git Repository Clone URL
- Click on Create button
- Before deploying your code to cPanel, you must have
.cpanel.yml
file on your source code. - In
.cpanel.yml
file
- Go to The deployment YAML file
---
deployment:
tasks:
- export DEPLOYPATH=/home/user/public_html/subfolder
- /bin/cp * $DEPLOYPATH
DEPLOYPATH=/home/user/public_html/subfolder
- Your website full path and replaceuser
with your cpanelusername
./bin/cp *
- '*' means all file deploy in cPanel
- Again, push the source code of your website to the Git Repository.
- In Git Version Control
- Click on
Manage
button, from the list - Click on
Update
button in Basic Information tab - Click on
Update from Remote
&Deploy Head Commit
button in Pull or Deploy tab
- Click on
- Finally, Check your website url.