#!/usr/bin/env bash
set -e
DIR=/var/www/wwwroot/crius
cd "$DIR"

git pull origin main

composer install --no-interaction --prefer-dist --no-dev

npm ci --ignore-scripts && npm run build

php artisan migrate --force

php artisan db:seed --class=CategorySeeder --force || true
php artisan db:seed --class=ProductSeeder --force || true

php artisan optimize
