update to sgeupdated pipeline v21

This commit is contained in:
2025-09-01 05:09:20 +03:00
parent 8fb923a4db
commit 5f8de8105b

View File

@@ -4,8 +4,8 @@ name: sgeUpdated CI/CD
on: on:
push: push:
branches: branches:
- main # trigger only when code is merged into main - main
workflow_dispatch: # allow manual trigger workflow_dispatch:
concurrency: concurrency:
group: sgeupdated-deploy-${{ github.ref }} group: sgeupdated-deploy-${{ github.ref }}
@@ -32,20 +32,30 @@ jobs:
git fetch origin main git fetch origin main
git reset --hard origin/main git reset --hard origin/main
echo "⚡ Rebuilding Backend..." # Rebuild backend if it has changed
cd sge-backend if git diff --name-only HEAD~1 HEAD | grep -q "^sge-backend/"; then
/opt/apache-maven-3.9.11/bin/mvn clean install -DskipTests echo "⚡ Rebuilding Backend..."
cd .. cd sge-backend
docker compose up -d --build backend /opt/apache-maven-3.9.11/bin/mvn clean install -DskipTests
cd ..
docker compose up -d --build backend
else
echo "✅ Backend unchanged, skipping rebuild."
fi
echo "⚡ Rebuilding Frontend..." # Rebuild frontend if it has changed
cd sge-frontend if git diff --name-only HEAD~1 HEAD | grep -q "^sge-frontend/"; then
rm -rf node_modules package-lock.json echo "⚡ Rebuilding Frontend..."
npm cache clean --force cd sge-frontend
npm install rm -rf node_modules package-lock.json
npm run build npm cache clean --force
cd .. npm install
docker compose up -d --build frontend npm run build
cd ..
docker compose up -d --build frontend
else
echo "✅ Frontend unchanged, skipping rebuild."
fi
echo "✅ Deployment complete. Current containers:" echo "✅ Deployment complete. Current containers:"
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'