Update sgeupdated pipeline v23+
Some checks failed
sgeUpdated CI/CD / deploy (push) Failing after 21s

This commit is contained in:
2025-10-23 12:47:17 +03:00
parent 845417ee49
commit 5471db463f

View File

@@ -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,19 +55,18 @@ jobs:
FRONTEND_CHANGED=true
fi
# Backend section
#if [ "$BACKEND_CHANGED" = true ]; then
#echo "⚡ Backend changes detected."
#cd sgeUpdated/sge-backend
#echo "Running Maven build..."
#/opt/apache-maven-3.9.11/bin/mvn clean install -DskipTests
# Backend section (currently commented out)
# if [ "$BACKEND_CHANGED" = true ]; then
# echo "⚡ Backend changes detected."
# cd sgeUpdated/sge-backend
# echo "Running Maven build..."
# /opt/apache-maven-3.9.11/bin/mvn clean install -DskipTests
# cd ../..
#echo "Rebuilding backend Docker container..."
#docker compose up -d --build bgreen-backend
#else
#echo "✅ No backend changes."
#fi
# echo "Rebuilding backend Docker container..."
# docker compose up -d --build bgreen-backend
# else
# echo "✅ No backend changes."
# fi
# Frontend section
if [ "$FRONTEND_CHANGED" = true ]; then
@@ -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."