deploy
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 3m28s

This commit is contained in:
2026-01-26 14:08:17 +01:00
parent 61b4b37111
commit 9c26ddddbf

View File

@@ -141,66 +141,52 @@ jobs:
echo "📡 Connecting to server and executing deployment commands..." echo "📡 Connecting to server and executing deployment commands..."
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Execute remote commands with error handling and logging # Execute remote commands with error handling and logging using bash -s
ssh -o StrictHostKeyChecking=accept-new \ ssh -o StrictHostKeyChecking=accept-new \
-o ServerAliveInterval=30 \ -o ServerAliveInterval=30 \
-o ServerAliveCountMax=3 \ -o ServerAliveCountMax=3 \
-o ConnectTimeout=10 \ -o ConnectTimeout=10 \
deploy@alpha.mintel.me \ -v \
"set -e deploy@alpha.mintel.me bash -s << 'ENDSSH'
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' set -ex
echo '📡 Remote Deployment Started' echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' echo '📡 Remote Deployment Started'
echo '' echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
echo ''
echo '🔐 Logging into registry on remote server...' echo '🔐 Logging into registry on remote server...'
echo '${{ secrets.REGISTRY_PASS }}' | docker login registry.infra.mintel.me -u '${{ secrets.REGISTRY_USER }}' --password-stdin echo '${{ secrets.REGISTRY_PASS }}' | docker login registry.infra.mintel.me -u '${{ secrets.REGISTRY_USER }}' --password-stdin
if [ \$? -eq 0 ]; then echo '✅ Remote registry login completed'
echo '✅ Remote registry login successful' echo ''
else
echo '❌ Remote registry login failed'
exit 1
fi
echo ''
echo '📂 Changing to deployment directory...' echo '📂 Changing to deployment directory...'
cd /home/deploy/sites/klz-cables.com cd /home/deploy/sites/klz-cables.com
echo '✅ Current directory: \$(pwd)' echo "✅ Current directory: $(pwd)"
echo '' echo ''
echo '📥 Pulling latest images...' echo '📥 Pulling latest images...'
docker compose pull docker compose pull
if [ \$? -eq 0 ]; then echo '✅ Image pull completed'
echo '✅ Image pull completed' echo ''
else
echo '❌ Image pull failed'
exit 1
fi
echo ''
echo '🔄 Starting containers with force-recreate...' echo '🔄 Starting containers with force-recreate...'
docker compose up -d --force-recreate --remove-orphans docker compose up -d --force-recreate --remove-orphans
if [ \$? -eq 0 ]; then echo '✅ Containers started'
echo '✅ Containers started successfully' echo ''
else
echo '❌ Container startup failed'
exit 1
fi
echo ''
echo '🧹 Cleaning up old images...' echo '🧹 Cleaning up old images...'
docker image prune -f docker image prune -f
echo '✅ Cleanup completed' echo '✅ Cleanup completed'
echo '' echo ''
echo '📊 Container Status:' echo '📊 Container Status:'
docker compose ps --format 'table {{.Name}}\t{{.State}}\t{{.Status}}' docker compose ps
echo '' echo ''
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
echo '✅ Remote Deployment Completed Successfully' echo '✅ Remote Deployment Completed Successfully'
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
" 2>&1 ENDSSH
DEPLOY_EXIT_CODE=$? DEPLOY_EXIT_CODE=$?
echo "" echo ""