This commit is contained in:
pbao9
2026-03-17 17:27:39 +07:00
parent ba0508ff67
commit 56ea3fd74a
+6 -14
View File
@@ -16,41 +16,33 @@ jobs:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.PORT || 22 }}
port: ${{ secrets.PORT }}
script: |
# Navigate to project directory
cd ${{ secrets.PROJECT_PATH || '/var/www/portal' }}
cd ${{ secrets.PROJECT_PATH }}
# Pull latest code
echo "🔄 Pulling latest code..."
git pull origin ${{ github.ref_name }}
git pull origin develop
# Install/Update Composer dependencies
echo "📦 Installing Composer dependencies..."
composer install --no-dev --optimize-autoloader
# Install/Update NPM dependencies
echo "📦 Installing NPM dependencies..."
npm ci --only=production
npm ci
# Build assets
echo "🏗️ Building assets..."
npm run production
npm run build
# Laravel optimizations
echo "⚡ Optimizing Laravel..."
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan optimize
# Clear application cache
echo "🧹 Clearing application cache..."
php artisan cache:clear
# Set permissions
echo "🔐 Setting permissions..."
chmod -R 755 storage bootstrap/cache
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache
echo "✅ Deployment completed successfully!"