From 808951bf64e29562029316aac2497abdc1415d38 Mon Sep 17 00:00:00 2001 From: Deploy Bot Date: Thu, 17 Jul 2025 20:34:49 -0400 Subject: [PATCH] Switch to dokku user for SSH access in GitHub Actions --- .github/workflows/test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 340b968..a93d746 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,7 +50,7 @@ jobs: Host dokku-test HostName localhost Port 2222 - User root + User dokku StrictHostKeyChecking no UserKnownHostsFile /dev/null IdentityFile ~/.ssh/id_ed25519 @@ -68,7 +68,12 @@ jobs: # Install the public key in the Dokku container cat ~/.ssh/id_ed25519.pub | ssh-keyscan -p 2222 -t ed25519 localhost > /dev/null 2>&1 || true - cat ~/.ssh/id_ed25519.pub | ssh -p 2222 -o StrictHostKeyChecking=no root@localhost "mkdir -p /root/.ssh && cat >> /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys" || true + # Wait for Dokku to be ready + echo "Waiting for Dokku to be ready..." + until docker exec dokku ps | grep -q sshd; do sleep 1; done + sleep 5 + # Add the key to the dokku user + cat ~/.ssh/id_ed25519.pub | ssh -p 2222 -o StrictHostKeyChecking=no dokku@localhost "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" || true # Test SSH connection echo "Testing SSH connection..."