forked from BLC/sgeUpdated
Update sgeupdated pipeline v16
This commit is contained in:
@@ -20,15 +20,18 @@ jobs:
|
||||
username: ${{ secrets.SERVER_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
script_stop: true
|
||||
|
||||
script: |
|
||||
cd /home/ubuntu/sgeUpdated
|
||||
git pull origin main
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
|
||||
echo "🔍 Detecting changes..."
|
||||
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
|
||||
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD || true)
|
||||
echo "Changed files: $CHANGED_FILES"
|
||||
|
||||
# --- Backend ---
|
||||
if echo "$CHANGED_FILES" | grep -q "^sge-backend/"; then
|
||||
if echo "$CHANGED_FILES" | grep -E "(^|/)sge-backend/"; then
|
||||
echo "⚙️ Backend changes detected. Rebuilding backend..."
|
||||
cd sge-backend
|
||||
mvn clean install -DskipTests
|
||||
@@ -40,7 +43,7 @@ jobs:
|
||||
fi
|
||||
|
||||
# --- Frontend ---
|
||||
if echo "$CHANGED_FILES" | grep -q "^sge-frontend/"; then
|
||||
if echo "$CHANGED_FILES" | grep -E "(^|/)sge-frontend/"; then
|
||||
echo "⚙️ Frontend changes detected. Rebuilding frontend..."
|
||||
cd sge-frontend
|
||||
npm install
|
||||
@@ -51,3 +54,4 @@ jobs:
|
||||
else
|
||||
echo "✅ No frontend changes detected."
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user