feat: implement VM snapshot management, enhance client resource loading, and refactor deployment workflow for production

This commit is contained in:
pbao9
2026-05-11 11:09:55 +07:00
parent 8aef607e1f
commit 96778e7bed
51 changed files with 2536 additions and 1249 deletions
+17 -16
View File
@@ -1,16 +1,19 @@
name: Deploy Portal API
name: Deploy Portal
on:
push:
branches: [ develop ]
branches:
- main
workflow_dispatch:
jobs:
deploy:
name: Deploy to Production
runs-on: ubuntu-latest
steps:
- name: Deploy to server
uses: appleboy/ssh-action@v1.0.3
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
@@ -19,20 +22,18 @@ jobs:
script_stop: true
script: |
set -e
echo "📁 Go to project path"
cd ${{ secrets.PROJECT_PATH }}
echo "🔄 Pulling latest code..."
git pull origin develop
echo "Pulling latest code..."
git pull origin main
echo "🐳 Rebuilding Docker container..."
docker compose up -d --build --remove-orphans portal
echo "Installing dependencies..."
composer install --no-dev --optimize-autoloader --no-interaction --no-progress
echo "⚡ Running Laravel optimizations..."
docker compose exec -T portal php artisan migrate --force
docker compose exec -T portal php artisan config:cache
docker compose exec -T portal php artisan route:cache
docker compose exec -T portal php artisan optimize
echo "Running migrations..."
php artisan migrate --force
echo "✅ Deployment completed!"
echo "Optimizing..."
php artisan optimize
echo "Deploy completed."