SFTP-Deploy-Action/action.yml

68 lines
1.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 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: true
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: ""
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 }}
branding:
icon: 'upload-cloud'
color: 'purple'