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