fix(ci): revert unstable SSH multiplexing and restore docker-compose upload
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Successful in 1m55s
Build & Deploy / 🏗️ Build (push) Successful in 11m18s
Build & Deploy / 🚀 Deploy (push) Successful in 24s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 2m58s
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Successful in 1m55s
Build & Deploy / 🏗️ Build (push) Successful in 11m18s
Build & Deploy / 🚀 Deploy (push) Successful in 24s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 2m58s
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -351,16 +351,6 @@ jobs:
|
|||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
ssh-keyscan -H alpha.mintel.me >> ~/.ssh/known_hosts 2>/dev/null
|
ssh-keyscan -H alpha.mintel.me >> ~/.ssh/known_hosts 2>/dev/null
|
||||||
|
|
||||||
# SSH multiplexing: reuse a single connection for all commands
|
|
||||||
cat >> ~/.ssh/config <<SSHEOF
|
|
||||||
Host alpha.mintel.me
|
|
||||||
ControlMaster auto
|
|
||||||
ControlPath /tmp/ssh-%r@%h:%p
|
|
||||||
ControlPersist 120
|
|
||||||
ServerAliveInterval 15
|
|
||||||
ServerAliveCountMax 3
|
|
||||||
SSHEOF
|
|
||||||
|
|
||||||
if [[ "$TARGET" == "production" ]]; then
|
if [[ "$TARGET" == "production" ]]; then
|
||||||
SITE_DIR="/home/deploy/sites/mintel.me"
|
SITE_DIR="/home/deploy/sites/mintel.me"
|
||||||
elif [[ "$TARGET" == "testing" ]]; then
|
elif [[ "$TARGET" == "testing" ]]; then
|
||||||
@@ -371,15 +361,12 @@ jobs:
|
|||||||
SITE_DIR="/home/deploy/sites/branch.mintel.me/${SLUG:-unknown}"
|
SITE_DIR="/home/deploy/sites/branch.mintel.me/${SLUG:-unknown}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Open persistent connection
|
# Upload files
|
||||||
ssh -fN root@alpha.mintel.me
|
|
||||||
|
|
||||||
# Upload files (reuses existing connection)
|
|
||||||
ssh root@alpha.mintel.me "mkdir -p $SITE_DIR/directus/schema $SITE_DIR/directus/uploads $SITE_DIR/directus/extensions"
|
ssh root@alpha.mintel.me "mkdir -p $SITE_DIR/directus/schema $SITE_DIR/directus/uploads $SITE_DIR/directus/extensions"
|
||||||
scp .env.deploy root@alpha.mintel.me:$SITE_DIR/$ENV_FILE
|
scp .env.deploy root@alpha.mintel.me:$SITE_DIR/$ENV_FILE
|
||||||
scp docker-compose.yml root@alpha.mintel.me:$SITE_DIR/docker-compose.yml
|
scp docker-compose.yml root@alpha.mintel.me:$SITE_DIR/docker-compose.yml
|
||||||
|
|
||||||
# Deploy (single SSH session for all docker commands)
|
# Deploy
|
||||||
DB_CONTAINER="${{ needs.prepare.outputs.project_name }}-postgres-db-1"
|
DB_CONTAINER="${{ needs.prepare.outputs.project_name }}-postgres-db-1"
|
||||||
ssh root@alpha.mintel.me bash <<DEPLOYEOF
|
ssh root@alpha.mintel.me bash <<DEPLOYEOF
|
||||||
set -e
|
set -e
|
||||||
@@ -394,9 +381,6 @@ jobs:
|
|||||||
docker system prune -f --filter 'until=24h'
|
docker system prune -f --filter 'until=24h'
|
||||||
DEPLOYEOF
|
DEPLOYEOF
|
||||||
|
|
||||||
# Cleanup multiplexed connection
|
|
||||||
ssh -O exit root@alpha.mintel.me 2>/dev/null || true
|
|
||||||
|
|
||||||
- name: 🧹 Post-Deploy Cleanup (Runner)
|
- name: 🧹 Post-Deploy Cleanup (Runner)
|
||||||
if: always()
|
if: always()
|
||||||
run: docker builder prune -f --filter "until=1h"
|
run: docker builder prune -f --filter "until=1h"
|
||||||
|
|||||||
Reference in New Issue
Block a user