Maintenance
Laravel Forge
What is Laravel Forge?
Laravel Forge is a server provisioning and deployment service for PHP applications. It allows you to easily deploy, manage, and scale your PHP applications on popular cloud hosting providers like AWS, DigitalOcean, and Linode. With Laravel Forge, you can set up servers, install software, configure databases, and deploy your applications with just a few clicks.
Deployment
Deployment Script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
git reset --hard
git clean -df
git pull origin $FORGE_SITE_BRANCH
$FORGE_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
npm i
npm run build --silent
if [ -f artisan ]; then
#$FORGE_PHP artisan migrate:refresh --seed
$FORGE_PHP artisan migrate
# Clear caches
$FORGE_PHP artisan optimize:clear
# Storage Link
$FORGE_PHP artisan storage:link
# Turn off maintenance mode
$FORGE_PHP artisan up
fi