#!/usr/bin/env bash
set -euo pipefail

# TaskFlow deployment script. Run from application root.
# Usage: ./deploy.sh

echo "Running git pull..."
git pull

echo "Installing Composer dependencies (no dev)..."
composer install --no-dev --optimize-autoloader

echo "Running migrations..."
php artisan migrate --force

echo "Linking storage..."
php artisan storage:link --force

echo "Caching config..."
php artisan config:cache

echo "Caching routes..."
php artisan route:cache

echo "Caching views..."
php artisan view:cache

echo "Restarting queue workers..."
php artisan queue:restart

echo "Deploy complete."
