Last active
May 5, 2022 22:39
-
-
Save vool/2e76b5062b71c8aab354 to your computer and use it in GitHub Desktop.
Post receive hook for Laravel website deploy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "********************" | |
echo "Post receive hook: Updating website" | |
echo "********************" | |
WEBROOT=/var/www/website | |
GIT_WORK_TREE=$WEBROOT git checkout -f | |
#change directory to the project dir | |
cd $WEBROOT | |
rm -f storage/cache/* | |
echo 'cache cleared' | |
rm -f storage/views/* | |
echo 'views cleared' | |
composer install | |
php artisan migrate | |
php artisan basset:build | |
php artisan cache:clear |
How do I revert back the release to the previous commit?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice inspiration, thank you. Quick note: you have
composer install
twice in it.