Skip to content

zathh/sftp-upload-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sftp-upload-action

this is a github action script for upload files to server via SFTP protocol.

Inputs

  host: 'example.com',                  # Required.
  port: 22,                             # Optional, Default to 22.
  username: 'user',                     # Required.
  password: 'password',                 # Optional.
  privateKey: '',                       # Optional, your private key(Raw content).
  passphrase: '',                       # Optional.
  agent: '',                            # Optional, path to the ssh-agent socket.
  localDir: 'dist',                     # Required, Absolute or relative to cwd.
  remoteDir: '/path/to/dest'            # Required, Absolute path only.
  dryRun: false                         # Optional. Default to false.
  exclude: 'node_modules/,**/*.spec.ts' # Optional. exclude patterns (glob), use ',' to split, Default to ''.
  excludeMode: 'remove'                 # Optional, Behavior for excluded files ('remove' or 'ignore'), Default to 'remove'.
  forceUpload: false                    # Optional, Force uploading all files, Default to false(upload only newer files).
  keepExtraFiles: false                 # Optional, Whether to delete files not present in remote. Default to false

Example usage

Use password

- name: SFTP uploader
  uses: wangyucode/sftp-upload-action@v1.3.3
  with:
    host: 'wycode.cn'
    password: ${{ secrets.password }} 
    localDir: 'dist'
    remoteDir: '/data/nginx/www/wycode.cn/'
    dryRun: true # use dryRun for test

Use privateKey

- name: SFTP uploader
  uses: wangyucode/sftp-upload-action@v1.3.3
  with:
    host: 'wycode.cn'
    privateKey: ${{ secrets.key }} 
    localDir: 'dist'
    remoteDir: '/data/nginx/www/wycode.cn/'
    dryRun: true # use dryRun for test

About

sftp upload using sftp-sync-deploy

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%