forked from Abdulbari/sgeUpdated
Update sgeupdated pipeline v23+
This commit is contained in:
@@ -13,6 +13,7 @@ concurrency:
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
@@ -28,7 +29,9 @@ jobs:
|
||||
set -euo pipefail
|
||||
|
||||
cd /home/ubuntu/Bgreen/sgeUpdated
|
||||
git fetch origin main
|
||||
|
||||
echo "📦 Fetching latest code from your fork..."
|
||||
git fetch myfork main
|
||||
|
||||
# Detect which files changed in the last commit
|
||||
CHANGED_FILES=$(git diff --name-only HEAD HEAD~1)
|
||||
@@ -36,7 +39,8 @@ jobs:
|
||||
echo "🪶 Changed files:"
|
||||
echo "$CHANGED_FILES"
|
||||
|
||||
git reset --hard origin/main
|
||||
echo "🔄 Resetting to your fork's main branch..."
|
||||
git reset --hard myfork/main
|
||||
|
||||
BACKEND_CHANGED=false
|
||||
FRONTEND_CHANGED=false
|
||||
@@ -51,8 +55,7 @@ jobs:
|
||||
FRONTEND_CHANGED=true
|
||||
fi
|
||||
|
||||
|
||||
# Backend section
|
||||
# Backend section (currently commented out)
|
||||
# if [ "$BACKEND_CHANGED" = true ]; then
|
||||
# echo "⚡ Backend changes detected."
|
||||
# cd sgeUpdated/sge-backend
|
||||
@@ -74,16 +77,15 @@ jobs:
|
||||
# npm run build
|
||||
cd ../..
|
||||
echo "Rebuilding frontend Docker container..."
|
||||
|
||||
docker compose up -d --build bgreen-frontend
|
||||
else
|
||||
echo "✅ No frontend changes."
|
||||
fi
|
||||
|
||||
# If no changes at all, just restart containers (commented out for now)
|
||||
#if [ "$BACKEND_CHANGED" = false ] && [ "$FRONTEND_CHANGED" = false ]; then
|
||||
#echo "♻️ No source changes detected. (Would restart containers here...)"
|
||||
#docker compose up -d
|
||||
#fi
|
||||
# If no changes at all, just restart containers (optional)
|
||||
if [ "$BACKEND_CHANGED" = false ] && [ "$FRONTEND_CHANGED" = false ]; then
|
||||
echo "♻️ No source changes detected. Restarting containers..."
|
||||
docker compose up -d
|
||||
fi
|
||||
|
||||
echo "✅ Check complete. (No rebuild or restart performed.)"
|
||||
echo "✅ Deployment check complete."
|
||||
|
||||
Reference in New Issue
Block a user