In this post, we will learn how to install and build frontend assets for a Laravel application and auto deploy on CPanel using GithHub Actions. When building applications with Laravel, you will typically use Vite to bundle your application's CSS and JavaScript files into production ready assets. Bundling assets on a cPanel server can be unfruitful due to limited system resource on a shared cPanel server. Using GitHub action, we can install and build our laravel application node dependecies and deploy it to our cPanel server everytime we push to our GitHub repository.

Now when we rerun our GitHub Action job and if it runs successfully, we will have our node_module and the public/build directories deployed successfully on our cPanel.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners