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.