- 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.ymlfile on your source code. - In
.cpanel.ymlfile
- 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 replaceuserwith 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
Managebutton, from the list - Click on
Updatebutton in Basic Information tab - Click on
Update from Remote&Deploy Head Commitbutton in Pull or Deploy tab
- Click on
- Finally, Check your website url.