Deploy Laravel project to Cpanel using Git extension
- add
.cpanel.yml' to your project and change the
DEPLOYPATH` to your path
---
deployment:
tasks:
- export DEPLOYPATH=/home/username/public_html/
- /bin/cp -r * $DEPLOYPATH
git init
git add .
- `git commit -m "First Commit"
git branch -M main
git remote add origin https://github.com/username/repo.git
git push -u origin main
- From CPanel choose
Git™ Version Control
-> Create - add repo url to
Clone URL
Choose any path you want for repository except in the
public_html
in.cpane.yml
file.Click
Update from Remote
button to fetch your file in repo to your repository path- Click
Deploy HEAD Commit
button to deploy and create or update the public_path