ci: harden ssh upload step with timeout and legacy scp
This commit is contained in:
@@ -57,7 +57,8 @@ jobs:
|
||||
run: |
|
||||
set -e
|
||||
REMOTE_BIN="/tmp/wx_service-${GITHUB_SHA}"
|
||||
scp -P "${PORT:-22}" tmp/wx_service "${USER:-root}@${HOST}:${REMOTE_BIN}"
|
||||
SSH_OPTS="-o BatchMode=yes -o ConnectTimeout=15 -o ServerAliveInterval=10 -o ServerAliveCountMax=3"
|
||||
scp -O ${SSH_OPTS} -P "${PORT:-22}" tmp/wx_service "${USER:-root}@${HOST}:${REMOTE_BIN}"
|
||||
|
||||
- name: Deploy on server
|
||||
env:
|
||||
@@ -67,7 +68,8 @@ jobs:
|
||||
run: |
|
||||
set -e
|
||||
REMOTE_BIN="/tmp/wx_service-${GITHUB_SHA}"
|
||||
ssh -p "${PORT:-22}" "${USER:-root}@${HOST}" \
|
||||
SSH_OPTS="-o BatchMode=yes -o ConnectTimeout=15 -o ServerAliveInterval=10 -o ServerAliveCountMax=3"
|
||||
ssh ${SSH_OPTS} -p "${PORT:-22}" "${USER:-root}@${HOST}" \
|
||||
"APP_DIR='/www/wwwroot/wx_service' \
|
||||
DIST_DIR='/www/wwwroot/wx_service/dist' \
|
||||
SOURCE_BIN='${REMOTE_BIN}' \
|
||||
|
||||
Reference in New Issue
Block a user