Deployment
Deploy with Forge
Step by step guide on deploying your project to production with Laravel Forge
Deploying with Laravel Forge
- Create a new server on Forge
- Add your SSH key to the server
- Add your domain to the server
- Add your GitHub repo to the server
- Deploy the project
Deployment script for Laravel Forge
cd /home/forge/YOUR_PROJECT_PATH
git fetch --all
git reset --hard origin/$FORGE_SITE_BRANCH
$FORGE_COMPOSER install --no-dev --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
if [ -f artisan ]; then
$FORGE_PHP artisan migrate --force
fi
php artisan cache:clear
php artisan generate:sitemap
npm install
npm run build