Update sgeupdated pipeline v12

a new update that fixed the docker files problem, it deletes the old ones then builds the new accordingly
This commit is contained in:
2025-08-30 02:56:08 +03:00
parent 37873ad091
commit e9a361489e

View File

@@ -32,27 +32,36 @@ jobs:
cd/home/ubuntu/sgeUpdated
git pull origin main
# --- Backend ---
if echo "${CHANGED_FILES}" | grep -q "sge-backend"; then
echo "Backend changes detected..."
cd sge-backend
mvn clean install
cd ..
docker build -t bgreen-backend ./sge-backend
docker compose up -d --force-recreate backend
fi
# --- Backend ---
if echo "${CHANGED_FILES}" | grep -q "sge-backend"; then
echo "Backend changes detected..."
cd sge-backend
mvn clean install
cd ..
# --- Frontend ---
if echo "${CHANGED_FILES}" | grep -q "sge-frontend"; then
echo "Frontend changes detected..."
cd sge-frontend
if echo "${CHANGED_FILES}" | grep -q "sge-frontend/package.json"; then
echo "package.json changed → installing dependencies"
npm install
fi
npm run build
cd ..
docker build -t bgreen-frontend ./sge-frontend
docker compose up -d --force-recreate frontend
fi
# Stop & remove old backend container (ignore errors if not exists)
docker stop sgeupdated-backend-1 || true
docker rm sgeupdated-backend-1 || true
# Build Docker image and restart container
docker compose build --no-cache backend
docker compose up -d --force-recreate backend
fi
# --- Frontend ---
if echo "${CHANGED_FILES}" | grep -q "sge-frontend"; then
echo "Frontend changes detected..."
cd sge-frontend
npm install
npm run build
cd ..
# Stop & remove old frontend container (ignore errors if not exists)
docker stop sgeupdated-frontend-1 || true
docker rm sgeupdated-frontend-1 || true
# Build Docker image and restart container
docker compose build --no-cache frontend
docker compose up -d --force-recreate frontend
fi