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

This commit is contained in:
2026-01-26 16:57:20 +01:00
parent 6dc0ff4644
commit cb207d6a01

View File

@@ -141,49 +141,45 @@ jobs:
echo "📡 Connecting to server and executing deployment commands..." echo "📡 Connecting to server and executing deployment commands..."
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "" echo ""
echo "🔍 DEBUG: Testing SSH connection first..."
ssh -o StrictHostKeyChecking=accept-new deploy@alpha.mintel.me 'echo "SSH connection test successful"; whoami; pwd'
echo ""
echo "🔍 DEBUG: Executing deployment commands..." # Execute deployment with proper command chaining - bypass login shell
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 \
-T \ -o LogLevel=ERROR \
deploy@alpha.mintel.me << EOF deploy@alpha.mintel.me \
set -ex "set -ex && \
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' && \
echo '📡 Remote Deployment Started' 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 && \
echo '✅ Remote registry login completed' echo '✅ Remote registry login completed' && \
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 '📥 Pulling latest images...' echo '📥 Pulling latest images...' && \
docker compose pull docker compose pull && \
echo '✅ Image pull completed' echo '✅ Image pull completed' && \
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 && \
echo '✅ Containers started' echo '✅ Containers started' && \
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 '📊 Container Status:' echo '📊 Container Status:' && \
docker compose ps docker compose ps && \
echo '' && \
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' && \
echo '✅ Remote Deployment Completed Successfully' echo '✅ Remote Deployment Completed Successfully' && \
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'"
EOF
DEPLOY_EXIT_CODE=$? DEPLOY_EXIT_CODE=$?
echo "" echo ""