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 "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
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 \
-o ServerAliveInterval=30 \
-o ServerAliveCountMax=3 \
-o ConnectTimeout=10 \
-T \
deploy@alpha.mintel.me << EOF
set -ex
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
echo '📡 Remote Deployment Started'
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
echo '🔐 Logging into registry on remote server...'
echo '${{ secrets.REGISTRY_PASS }}' | docker login registry.infra.mintel.me -u '${{ secrets.REGISTRY_USER }}' --password-stdin
echo '✅ Remote registry login completed'
echo '📂 Changing to deployment directory...'
cd /home/deploy/sites/klz-cables.com
echo "✅ Current directory: \$(pwd)"
echo '📥 Pulling latest images...'
docker compose pull
echo '✅ Image pull completed'
echo '🔄 Starting containers with force-recreate...'
docker compose up -d --force-recreate --remove-orphans
echo '✅ Containers started'
echo '🧹 Cleaning up old images...'
docker image prune -f
echo '✅ Cleanup completed'
echo '📊 Container Status:'
docker compose ps
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
echo '✅ Remote Deployment Completed Successfully'
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
EOF
-o LogLevel=ERROR \
deploy@alpha.mintel.me \
"set -ex && \
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' && \
echo '📡 Remote Deployment Started' && \
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' && \
echo '' && \
echo '🔐 Logging into registry on remote server...' && \
echo '${{ secrets.REGISTRY_PASS }}' | docker login registry.infra.mintel.me -u '${{ secrets.REGISTRY_USER }}' --password-stdin && \
echo '✅ Remote registry login completed' && \
echo '' && \
echo '📂 Changing to deployment directory...' && \
cd /home/deploy/sites/klz-cables.com && \
echo '✅ Current directory:' && pwd && \
echo '' && \
echo '📥 Pulling latest images...' && \
docker compose pull && \
echo '✅ Image pull completed' && \
echo '' && \
echo '🔄 Starting containers with force-recreate...' && \
docker compose up -d --force-recreate --remove-orphans && \
echo '✅ Containers started' && \
echo '' && \
echo '🧹 Cleaning up old images...' && \
docker image prune -f && \
echo '✅ Cleanup completed' && \
echo '' && \
echo '📊 Container Status:' && \
docker compose ps && \
echo '' && \
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' && \
echo '✅ Remote Deployment Completed Successfully' && \
echo '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'"
DEPLOY_EXIT_CODE=$?
echo ""