Nisse Lommerde 76a5d72cf1
Some checks failed
Deploy / deploy (push) Failing after 8s
Testing deploy runner
2025-03-04 14:37:34 -05:00

38 lines
749 B
Bash

#!/bin/bash
set -e
echo "Deployment started ..."
chown -R act_runner:www-data /var/www/sewtopnotch.com
# Enter maintenance mode or return true
# if already is in maintenance mode
(php artisan down) || true
# Pull the latest version of the app from main branch
git pull origin main
# Install composer dependencies
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
# Clear the old cache
php artisan clear-compiled
# Recreate cache
php artisan optimize
# Npm stuff (ci will fail when lockfile modified)
npm ci
npm run build
# Run database migrations
php artisan migrate --force
# permissions
chown -R www-data:www-data /var/www/sewtopnotch.com
# Exit maintenance mode
php artisan up
echo "Deployment finished!"