update to sgeupdated pipeline v20+++

This commit is contained in:
2025-09-01 05:14:58 +03:00
parent 04ed88e45e
commit b37ed8797b

View File

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