fix build
Build & Deploy / Build & Push Docker Image (push) Failing after 2s
Build & Deploy / Deploy to VPS (push) Has been skipped

This commit is contained in:
root
2026-07-04 01:40:59 -04:00
parent 765c1ede8f
commit 2d5f34fc65
+14 -6
View File
@@ -135,8 +135,8 @@ jobs:
- name: Check SSH tools - name: Check SSH tools
run: | run: |
if ! command -v ssh >/dev/null 2>&1 || ! command -v tar >/dev/null 2>&1; then if ! command -v ssh >/dev/null 2>&1 || ! command -v ssh-keygen >/dev/null 2>&1 || ! command -v tar >/dev/null 2>&1; then
echo "::error::ssh and tar must be available in the runner image; this workflow cannot install packages while runner DNS is unavailable." echo "::error::ssh, ssh-keygen, and tar must be available in the runner image; this workflow cannot install packages while runner DNS is unavailable."
exit 1 exit 1
fi fi
@@ -147,8 +147,12 @@ jobs:
VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}" VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}"
echo "Using SSH host $VPS_HOST" echo "Using SSH host $VPS_HOST"
mkdir -p ~/.ssh && chmod 700 ~/.ssh mkdir -p ~/.ssh && chmod 700 ~/.ssh
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa printf '%b\n' '${{ secrets.VPS_SSH_KEY }}' | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
if ! ssh-keygen -y -f ~/.ssh/id_rsa >/dev/null 2>&1; then
echo "::error::VPS_SSH_KEY is not a readable private key. Store the full private key with real newlines, including BEGIN and END lines."
exit 1
fi
touch ~/.ssh/known_hosts touch ~/.ssh/known_hosts
ssh-keyscan -H "$VPS_HOST" >> ~/.ssh/known_hosts 2>/dev/null || true ssh-keyscan -H "$VPS_HOST" >> ~/.ssh/known_hosts 2>/dev/null || true
chmod 644 ~/.ssh/known_hosts chmod 644 ~/.ssh/known_hosts
@@ -289,8 +293,8 @@ jobs:
- name: Install SSH client - name: Install SSH client
if: steps.check-creds.outputs.skip == 'false' if: steps.check-creds.outputs.skip == 'false'
run: | run: |
if ! command -v ssh >/dev/null 2>&1 || ! command -v scp >/dev/null 2>&1; then if ! command -v ssh >/dev/null 2>&1 || ! command -v ssh-keygen >/dev/null 2>&1 || ! command -v scp >/dev/null 2>&1; then
echo "::error::ssh and scp must be available in the runner image; this workflow cannot install openssh-client while runner DNS is unavailable." echo "::error::ssh, ssh-keygen, and scp must be available in the runner image; this workflow cannot install openssh-client while runner DNS is unavailable."
exit 1 exit 1
fi fi
@@ -302,8 +306,12 @@ jobs:
VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}" VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}"
echo "Using SSH host $VPS_HOST" echo "Using SSH host $VPS_HOST"
mkdir -p ~/.ssh && chmod 700 ~/.ssh mkdir -p ~/.ssh && chmod 700 ~/.ssh
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa printf '%b\n' '${{ secrets.VPS_SSH_KEY }}' | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
if ! ssh-keygen -y -f ~/.ssh/id_rsa >/dev/null 2>&1; then
echo "::error::VPS_SSH_KEY is not a readable private key. Store the full private key with real newlines, including BEGIN and END lines."
exit 1
fi
touch ~/.ssh/known_hosts touch ~/.ssh/known_hosts
ssh-keyscan -H "$VPS_HOST" >> ~/.ssh/known_hosts 2>/dev/null || true ssh-keyscan -H "$VPS_HOST" >> ~/.ssh/known_hosts 2>/dev/null || true
chmod 644 ~/.ssh/known_hosts chmod 644 ~/.ssh/known_hosts