Files
Sistema-Educativo-Laravel/.cpanel.yml

25 lines
1.1 KiB
YAML

deployment:
tasks:
- export DEPLOYPATH=/home/inventario
# Sync application files to home directory (one level above public_html)
- /bin/rsync -az --exclude='.git' --exclude='node_modules' --exclude='.env' --exclude='public' . $DEPLOYPATH/
# Sync public directory to public_html, preserving storage symlink
- /bin/rsync -az --delete --exclude='storage' public/ $DEPLOYPATH/public_html/
# Install PHP dependencies
- /opt/cpanel/ea-php83/root/usr/bin/php /usr/local/bin/composer install --no-dev --optimize-autoloader --no-interaction --working-dir=$DEPLOYPATH
# Set writable permissions for Laravel
- /bin/chmod -R 755 $DEPLOYPATH/storage
- /bin/chmod -R 755 $DEPLOYPATH/bootstrap/cache
# Create storage symlink (public_html/storage -> storage/app/public)
- /bin/ln -sfn $DEPLOYPATH/storage/app/public $DEPLOYPATH/public_html/storage
# Rebuild Laravel caches
- /opt/cpanel/ea-php83/root/usr/bin/php $DEPLOYPATH/artisan optimize:clear
- /opt/cpanel/ea-php83/root/usr/bin/php $DEPLOYPATH/artisan optimize
- /opt/cpanel/ea-php83/root/usr/bin/php $DEPLOYPATH/artisan migrate --force