Skip to content

Instantly share code, notes, and snippets.

@Ale-Code404
Created October 19, 2023 16:47
Show Gist options
  • Save Ale-Code404/07fb23d92b0433723b9ac9985e4b2742 to your computer and use it in GitHub Desktop.
Save Ale-Code404/07fb23d92b0433723b9ac9985e4b2742 to your computer and use it in GitHub Desktop.
Template para implementar compilacion tipo CI en el hook "post-receive" en un proyecto Laravel
#!/bin/bash
site=/var/www/{site_name}
git_dir={project_git_directory}
git --work-tree="${site}" checkout -f main
cd $site
#Install composer dependencies
composer install --no-dev
composer dump-autoload
#Clear all cache
php $site/artisan config:clear
#Install node dependencies
npm i --omits=dev
#Compile assets
npm run production
echo "Success deploy..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment