-
Laravel
-
Vue.js
-
Vite
-
GitHub
-
GitHub Actions
-
SSH
-
cPanel
-
Linux Server
Step 1 – Create a GitHub Repository
Create a new repository.
Example:
Clone it locally:
or if the project already exists:
Step 2 – Clone Repository on Server
Login via SSH
Go to your project directory.
Example
Clone directly inside the folder
Notice the dot (.)
Without the dot Git creates
With the dot
which is what Laravel requires.
Step 3 – Setup SSH Authentication
GitHub no longer supports password authentication.
Generate SSH key
If another key already exists
Create a new one
Example
Save as
Step 4 – Allow GitHub Actions to Login
Display public key
Append it
Fix permissions
Step 5 – Test SSH
Run
Expected
Step 6 – GitHub Repository Secrets
Open
Create
| Secret | Value |
|---|
| SERVER_HOST | Your Server IP/Hostname |
| SERVER_PORT | 22 |
| SERVER_USER | cPanel Username |
| SERVER_SSH_KEY | Private Key (github_actions) |
Step 7 – Create GitHub Workflow
Create
Step 8 – Push Code
GitHub Actions will start automatically.
Step 9 – Monitor Deployment
Open
You'll see
Click it to watch the deployment.
Problems We Faced & Solutions
1. Git Clone Asked for Username & Password
Error
Solution
Use SSH instead of HTTPS.
Wrong
Correct
2. Repository Created an Extra Folder
Problem
Solution
Clone into current directory
Notice the dot.
3. Composer Failed During Deployment
Reason
Laravel couldn't boot because
was missing.
Solution
Create
Configure
-
APP_KEY
-
Database
-
Mail
-
Redis
-
Queue
Generate key
4. Migration Failed
Error
Reason
Database already contained the column.
Solution
Remove automatic migration
and manage production schema manually.
5. Route Cache Failed
Error
Reason
Duplicate route names.
Example
defined twice.
Solution
Rename one route.
6. @routes Printed on Screen
Reason
Laravel cache issue.
Solution
Run
7. route() is not defined
Reason
Application cache or frontend assets were outdated.
Solution
Production Recommendations
✔ Never commit
✔ Never commit
✔ Never commit
✔ Always use
✔ Backup database before deployment.
✔ Review migrations before applying them in production.
✔ Keep Composer dependencies optimized.
Useful Commands
Clone
Pull
Composer
Node
Build
Clear Cache
Config Cache
View Cache
Final Workflow
Conclusion
Using GitHub Actions with SSH and cPanel provides a reliable, repeatable deployment process for Laravel + Vue.js applications. Once configured, every push to the main branch automatically updates your server, eliminating manual uploads and reducing deployment errors. As your application grows, you can extend this pipeline with automated tests, code quality checks, and zero-downtime deployment strategies.
This setup not only saves time but also makes deployments consistent and easier to maintain for both solo developers and teams.
0 Comment's
Add Comment
Register to Reply