fix build 3
This commit is contained in:
@@ -184,13 +184,24 @@ jobs:
|
||||
ssh-keyscan -H "$VPS_HOST" >> ~/.ssh/known_hosts 2>/dev/null || true
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
|
||||
- name: Test SSH authentication
|
||||
env:
|
||||
VPS_HOST: ${{ secrets.VPS_IP }}
|
||||
run: |
|
||||
VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}"
|
||||
SSH_OPTIONS="-i $HOME/.ssh/id_rsa -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
if ! ssh $SSH_OPTIONS "${{ secrets.VPS_USER }}@$VPS_HOST" "printf 'ssh authenticated as '; whoami"; then
|
||||
echo "::error::SSH authentication failed. Verify VPS_USER matches the account that has the deploy public key in ~/.ssh/authorized_keys on $VPS_HOST."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Sync build context to VPS
|
||||
env:
|
||||
REMOTE_BUILD_DIR: ${{ env.DEPLOY_ROOT }}/build-context
|
||||
VPS_HOST: ${{ secrets.VPS_IP }}
|
||||
run: |
|
||||
VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}"
|
||||
SSH_OPTIONS="-o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
SSH_OPTIONS="-i $HOME/.ssh/id_rsa -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
ssh $SSH_OPTIONS "${{ secrets.VPS_USER }}@$VPS_HOST" \
|
||||
"rm -rf '$REMOTE_BUILD_DIR' && mkdir -p '$REMOTE_BUILD_DIR'"
|
||||
tar \
|
||||
@@ -219,7 +230,7 @@ jobs:
|
||||
VPS_HOST: ${{ secrets.VPS_IP }}
|
||||
run: |
|
||||
VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}"
|
||||
SSH_OPTIONS="-o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
SSH_OPTIONS="-i $HOME/.ssh/id_rsa -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
REGISTRY_PASSWORD_B64="$(printf '%s' "$REGISTRY_PASSWORD" | base64 | tr -d '\n')"
|
||||
ssh $SSH_OPTIONS "${{ secrets.VPS_USER }}@$VPS_HOST" "
|
||||
set -e
|
||||
@@ -367,13 +378,25 @@ jobs:
|
||||
ssh-keyscan -H "$VPS_HOST" >> ~/.ssh/known_hosts 2>/dev/null || true
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
|
||||
- name: Test SSH authentication
|
||||
if: steps.check-creds.outputs.skip == 'false'
|
||||
env:
|
||||
VPS_HOST: ${{ secrets.VPS_IP }}
|
||||
run: |
|
||||
VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}"
|
||||
SSH_OPTIONS="-i $HOME/.ssh/id_rsa -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
if ! ssh $SSH_OPTIONS "${{ secrets.VPS_USER }}@$VPS_HOST" "printf 'ssh authenticated as '; whoami"; then
|
||||
echo "::error::SSH authentication failed. Verify VPS_USER matches the account that has the deploy public key in ~/.ssh/authorized_keys on $VPS_HOST."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Sync deployment assets
|
||||
if: steps.check-creds.outputs.skip == 'false'
|
||||
env:
|
||||
VPS_HOST: ${{ secrets.VPS_IP }}
|
||||
run: |
|
||||
VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}"
|
||||
SSH_OPTIONS="-o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
SSH_OPTIONS="-i $HOME/.ssh/id_rsa -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
ssh $SSH_OPTIONS "${{ secrets.VPS_USER }}@$VPS_HOST" \
|
||||
"mkdir -p '$DEPLOY_ROOT/scripts' '$DEPLOY_ROOT/docker/pgmanage' '$DEPLOY_ROOT/docker/registry/auth' '$DEPLOY_ROOT/dynamic'"
|
||||
scp $SSH_OPTIONS docker-compose.production.yml \
|
||||
@@ -396,7 +419,7 @@ jobs:
|
||||
VPS_HOST: ${{ secrets.VPS_IP }}
|
||||
run: |
|
||||
VPS_HOST="${VPS_HOST:-$DEPLOY_SSH_HOST}"
|
||||
SSH_OPTIONS="-o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
SSH_OPTIONS="-i $HOME/.ssh/id_rsa -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=$HOME/.ssh/known_hosts"
|
||||
REGISTRY_PASSWORD_B64="$(printf '%s' "${{ secrets.REGISTRY_PASSWORD }}" | base64 | tr -d '\n')"
|
||||
ssh $SSH_OPTIONS "${{ secrets.VPS_USER }}@$VPS_HOST" "
|
||||
set -e
|
||||
|
||||
Reference in New Issue
Block a user