-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
40 lines (40 loc) · 1.51 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: 'Deploy a directory using SSH'
description: 'Connects to a server via SSH and copies scripts to the target'
inputs:
key-name:
description: 'Name of the file the private key is temporarily saved in. Defaults to `identity`.'
required: true
default: 'identity'
port:
description: 'The SSH port to use. Defaults to `22`.'
required: true
default: '22'
source:
description: 'The directory that should be used as the copy-source.'
required: true
target:
description: 'The directory that should be used on the copy-target.'
required: true
user:
description: 'The SSH user that will be used to connect to the host.'
required: true
host:
description: 'The SSH-server (host) to connect to.'
required: true
chmod-mask:
description: 'The mask to set using chmod before deploying the source files.'
required: true
default: '777'
chmod-selector:
description: 'The selector (e.g. `./deploy/*.sh`) to use when chmodding.'
required: false
runs:
using: "composite"
steps:
- name: Use SSH - chmod <mask> <selector>
shell: bash
if: "${{ inputs.chmod-mask != '' && inputs.chmod-selector != '' }}"
run: sudo chmod ${{ inputs.chmod-mask }} ${{ inputs.chmod-selector }}
- name: Use SSH - rsync deploy dir to target
shell: bash
run: rsync -azh -e 'ssh -i .ssh/${{ inputs.key-name }} -p '"${{ inputs.port }}"'' ${{ inputs.source }} ${{ inputs.user }}@${{ inputs.host }}:${{ inputs.target }}/