test
This commit is contained in:
@@ -8,49 +8,41 @@ on:
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
steps:
|
||||
- name: Deploy to server
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
port: ${{ secrets.PORT || 22 }}
|
||||
script: |
|
||||
# Navigate to project directory
|
||||
cd ${{ secrets.PROJECT_PATH || '/var/www/portal' }}
|
||||
|
||||
# Pull latest code
|
||||
echo "🔄 Pulling latest code..."
|
||||
git pull origin ${{ github.ref_name }}
|
||||
|
||||
# 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
|
||||
|
||||
# Build assets
|
||||
echo "🏗️ Building assets..."
|
||||
npm run production
|
||||
|
||||
# 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
|
||||
chown -R www-data:www-data storage bootstrap/cache
|
||||
|
||||
echo "✅ Deployment completed successfully!"
|
||||
- name: Deploy to server
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
script: |
|
||||
cd ${{ secrets.PROJECT_PATH }}
|
||||
|
||||
echo "🔄 Pulling latest code..."
|
||||
git pull origin develop
|
||||
|
||||
echo "📦 Installing Composer dependencies..."
|
||||
composer install --no-dev --optimize-autoloader
|
||||
|
||||
echo "📦 Installing NPM dependencies..."
|
||||
npm ci
|
||||
|
||||
echo "🏗️ Building assets..."
|
||||
npm run build
|
||||
|
||||
echo "⚡ Optimizing Laravel..."
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
php artisan view:cache
|
||||
php artisan optimize
|
||||
|
||||
echo "🧹 Clearing application cache..."
|
||||
php artisan cache:clear
|
||||
|
||||
echo "🔐 Setting permissions..."
|
||||
chmod -R 775 storage bootstrap/cache
|
||||
chown -R www-data:www-data storage bootstrap/cache
|
||||
|
||||
echo "✅ Deployment completed successfully!"
|
||||
Reference in New Issue
Block a user