Switch argument passing, add restart nginx
This commit is contained in:
parent
d1965cf276
commit
0ac14c6c99
11
action.yml
11
action.yml
@ -9,9 +9,14 @@ inputs:
|
||||
deploy_path:
|
||||
description: 'Deploy path'
|
||||
required: true
|
||||
restart_nginx:
|
||||
description: 'Restart nginx'
|
||||
default: no
|
||||
required: false
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
args:
|
||||
- ${{ inputs.local_path }}
|
||||
- ${{ inputs.deploy_path }}
|
||||
env:
|
||||
INPUT_LOCAL_PATH: ${{ inputs.local_path }}
|
||||
INPUT_DEPLOY_PATH: ${{ inputs.deploy_path }}
|
||||
INPUT_RESTART_NGINX: ${{ inputs.restart_nginx }}
|
||||
|
@ -1,8 +1,11 @@
|
||||
#!/bin/sh -l
|
||||
|
||||
LOCAL_PATH="$1"
|
||||
DEPLOY_PATH="$2"
|
||||
env
|
||||
|
||||
rsync -hrz --delete -C --exclude=".*" -e ssh "$LOCAL_PATH" "deploy.sixohthree.com:/tmp/gitea_${GITHUB_RUN_NUMBER}_${GITHUB_SHA}"
|
||||
ssh deploy.sixohthree.com "dsh -M -c -r ssh -g webs -- rsync -hvrz --delete -C -e ssh deploy.sixohthree.com:/tmp/gitea_${GITHUB_RUN_NUMBER}_${GITHUB_SHA}/ $DEPLOY_PATH"
|
||||
rsync -hrz --delete -C --exclude=".*" -e ssh "$INPUT_LOCAL_PATH" "deploy.sixohthree.com:/tmp/gitea_${GITHUB_RUN_NUMBER}_${GITHUB_SHA}"
|
||||
ssh deploy.sixohthree.com "dsh -M -c -r ssh -g webs -- rsync -hvrz --delete -C -e ssh deploy.sixohthree.com:/tmp/gitea_${GITHUB_RUN_NUMBER}_${GITHUB_SHA}/ $INPUT_DEPLOY_PATH"
|
||||
ssh deploy.sixohthree.com "rm -rf /tmp/gitea_${GITHUB_RUN_NUMBER}_${GITHUB_SHA}"
|
||||
|
||||
if [ "$INPUT_RESTART_NGINX" ]; then
|
||||
ssh deploy.sixohthree.com "dsh -M -c -r ssh -g webs -- sudo systemctl reload nginx"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user