diff --git a/.gitea/workflows/sgeupdated.yml b/.gitea/workflows/sgeupdated.yml index 7db6045..2542f23 100644 --- a/.gitea/workflows/sgeupdated.yml +++ b/.gitea/workflows/sgeupdated.yml @@ -24,19 +24,30 @@ jobs: cd /home/ubuntu/sgeUpdated git pull origin main - echo "Detecting changes..." + echo "🔍 Detecting changes..." CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD) # --- Backend --- - if echo "$CHANGED_FILES" | grep -q "sge-backend"; then - echo "⚙️ Backend changes detected..." + if echo "$CHANGED_FILES" | grep -q "^sge-backend/"; then + echo "⚙️ Backend changes detected. Rebuilding backend..." + cd sge-backend + mvn clean install -DskipTests + cd .. docker compose build --no-cache backend docker compose up -d --force-recreate backend + else + echo "✅ No backend changes detected." fi # --- Frontend --- - if echo "$CHANGED_FILES" | grep -q "sge-frontend"; then - echo "⚙️ Frontend changes detected..." + if echo "$CHANGED_FILES" | grep -q "^sge-frontend/"; then + echo "⚙️ Frontend changes detected. Rebuilding frontend..." + cd sge-frontend + npm install + npm run build + cd .. docker compose build --no-cache frontend docker compose up -d --force-recreate frontend + else + echo "✅ No frontend changes detected." fi