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

This commit is contained in:
2026-01-26 23:28:23 +01:00
parent d40f4544ea
commit 3f17d08b04

View File

@@ -118,7 +118,7 @@ jobs:
echo ""
echo "🚀 Starting deployment process..."
echo " Target Server: alpha.mintel.me"
echo " Deploy User: deploy"
echo " Deploy User: deploy (via sudo from root)"
echo " Target Path: /home/deploy/sites/klz-cables.com"
echo ""
@@ -142,44 +142,14 @@ jobs:
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Execute deployment with proper command chaining - use bash directly to bypass .bashrc exit
# SSH as root and use sudo to run deployment script as deploy user
# This works around the broken SSH output issue with deploy user
ssh -o StrictHostKeyChecking=accept-new \
-o ServerAliveInterval=30 \
-o ServerAliveCountMax=3 \
-o ConnectTimeout=10 \
-o LogLevel=ERROR \
deploy@alpha.mintel.me \
"bash --noprofile --norc -c '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 (Explicit Pull)...' && \
docker pull registry.infra.mintel.me/mintel/klz-cables.com:latest && \
echo '✅ Image pull completed' && \
echo '' && \
echo '🔄 Starting containers with pull and force-recreate...' && \
docker compose up -d --pull always --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 '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━''"
root@alpha.mintel.me \
"sudo -u deploy /home/deploy/deploy.sh"
DEPLOY_EXIT_CODE=$?
echo ""