chore(build-and-push): add fail-fast SSH probe to remote builder host

Surfaces the real reachability/auth error instead of buildx's slow
'context deadline exceeded' when the runner can't reach the daemon.
This commit is contained in:
2026-07-12 13:24:34 -03:00
parent 57e25a8fef
commit a7dfc7c7dd

View File

@@ -64,12 +64,22 @@ runs:
env:
SSH_KEY: ${{ inputs.ssh_key }}
BUILDER_HOST: ${{ inputs.docker_host }}
BUILDER_USER: ${{ inputs.docker_user }}
run: |
mkdir -p ~/.ssh
echo "${SSH_KEY}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan "${BUILDER_HOST}" >> ~/.ssh/known_hosts
# Fail fast with a real diagnostic instead of a slow buildx
# "context deadline exceeded" if the runner can't reach / auth to the
# remote docker daemon over SSH.
echo "== probing ssh://${BUILDER_USER}@${BUILDER_HOST} =="
ssh -o BatchMode=yes -o ConnectTimeout=10 \
-i ~/.ssh/id_ed25519 \
"${BUILDER_USER}@${BUILDER_HOST}" \
'docker version --format "server={{.Server.Version}}"'
- name: Set up remote Docker Buildx builder
shell: bash
env: