mirror of
https://github.com/wlixcc/SFTP-Deploy-Action.git
synced 2026-09-23 13:18:32 +00:00
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
# action.yml
|
||
name: 'SFTP Deploy'
|
||
description: 'Deploy file to your server use sftp & ssh private key'
|
||
inputs:
|
||
username:
|
||
description: 'username'
|
||
required: true
|
||
server:
|
||
description: 'your sftp server'
|
||
required: true
|
||
port:
|
||
description: 'your sftp server port, default to 22'
|
||
required: true
|
||
default: "22"
|
||
ssh_private_key:
|
||
description: 'you can copy private_key from your *.pem file, keep format'
|
||
required: false
|
||
local_path:
|
||
description: 'will put all file under this path'
|
||
required: true
|
||
default: ./*
|
||
remote_path:
|
||
description: 'files will copy to under remote_path'
|
||
required: true
|
||
sftp_only:
|
||
description: 'connection via sftp protocol only'
|
||
required: false
|
||
default: false
|
||
sftpArgs:
|
||
description: 'sftp args'
|
||
required: false
|
||
delete_remote_files:
|
||
description: 'This operation will delete all files in the remote path before upload. Please be careful set this to true'
|
||
required: false
|
||
default: false
|
||
password:
|
||
description: "SSH passsword,If a password is set, the secret key pair is ignored"
|
||
required: false
|
||
rsyncArgs:
|
||
description: "Additional arguments for the rsync command.
|
||
You can use this parameter to customize the rsync behavior, such as excluding files or directories.
|
||
Example: '--exclude=node_modules --exclude=.git --exclude=*.log'.
|
||
If set, these arguments will be passed directly to the rsync command."
|
||
required: false
|
||
default: ""
|
||
ssh_passphrase:
|
||
description: "Passphrase for ssh encrypted private-key. If the private-key is not encrypted, this parameter is not required."
|
||
required: false
|
||
|
||
runs:
|
||
using: 'docker'
|
||
image: 'Dockerfile'
|
||
args:
|
||
- ${{ inputs.username }}
|
||
- ${{ inputs.server }}
|
||
- ${{ inputs.port }}
|
||
- ${{ inputs.ssh_private_key }}
|
||
- ${{ inputs.local_path }}
|
||
- ${{ inputs.remote_path }}
|
||
- ${{ inputs.sftp_only }}
|
||
- ${{ inputs.sftpArgs }}
|
||
- ${{ inputs.delete_remote_files }}
|
||
- ${{ inputs.password }}
|
||
- ${{ inputs.rsyncArgs }}
|
||
- ${{ inputs.ssh_passphrase }}
|
||
|
||
|
||
branding:
|
||
icon: 'upload-cloud'
|
||
color: 'purple'
|