Skip to content

Instantly share code, notes, and snippets.

@bpocallaghan
Last active October 30, 2023 20:38
Show Gist options
  • Save bpocallaghan/6ff968ab78433076b0c53db3542f3595 to your computer and use it in GitHub Desktop.
Save bpocallaghan/6ff968ab78433076b0c53db3542f3595 to your computer and use it in GitHub Desktop.
Laravel Forge Deploy Script
cd /home/forge/domain
# turn on maintenance mode
#php artisan down
git fetch --all
git reset --hard origin/master
composer install --no-interaction --prefer-dist --optimize-autoloader
( flock -w 10 9 || exit 1
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock
# migrate database
#php artisan migrate --force
# clear caches
php artisan cache:clear
# clear expired password reset tokens
php artisan auth:clear-resets
# clear and cache routes
php artisan route:clear
php artisan route:cache
# clear and cache config
php artisan config:clear
php artisan config:cache
# clear and cache views
php artisan view:clear
php artisan view:cache
# restart the queue worker
php artisan queue:restart
# compile assets and minify
#npm install
#npm run production
# turn off maintenance mode
#php artisan up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment