-
-
Save jpalala/a27be293eeeb7def6f4f212b892e37b3 to your computer and use it in GitHub Desktop.
Laravel deploy script
This file contains 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
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 | |
Author
jpalala
commented
Jul 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment