FORGE_SITE_BRANCH=master #change this to the branch that is needed to be deployted PROJECT_DIR="/var/www/html" # Path to Project directory ENV_BKP_DIR="../" cd $PROJECT_DIR cp .env $ENV_BKP_DIR/.env.bkp # Maintenance mode php artisan down || true git pull origin $FORGE_SITE_BRANCH # install new dependencies composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev # Run database migrations # WARNING: If in prod - back first and/or move specific scripts to a temporary folder # php artisan migrate --force # Clear caches - clear expired password reset tokens, # Clear and cache routes # Clear and cache config # Clear and cache views php artisan cache:clear && php artisan auth:clear-resets && php artisan route:cache && php artisan config:cache && php artisan view:cache # Turn the lights on php artisan up