Skip to content

doanduc/action-rsyncer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSyncer GitHub Action

Action on GH marketplace   GitHub release   GitHub

This action uses rsync to sync files (probably) generated by a previous step in the workflow with a remote server.

Secrets

DEPLOY_KEY

Required SSH Key to be used during the rsync operation.

Inputs

flags

Required Flags to pass to rsync. Default -avzr --delete.

options

Required Rsync options. i.e. --exclude.

ssh_options

Required SSH command options. i.e. -p 2222.

src

Required Local path to be synced. i.e. public/.

dest

Required Remote server and path. i.e [email protected]:/var/www/server.com/.

Outputs

status

Friendly status of the rsync command.

Usage

Sync local folder to remote server

This example syncs the local folder public with the /var/www/server.com folder on the remote server server.com.

Add the a workflow file in your repository: .github/workflows/rsync.yml.

- name: Deploy to server
  id: deploy
  uses: Pendect/[email protected]
  env:
    DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
  with:
    flags: '-avzr --delete'
    options: ''
    ssh_options: ''
    src: 'public/'
    dest: '[email protected]:/var/www/server.com'

- name: Display status from deploy
  run: echo "${{ steps.deploy.outputs.status }}"

Use distinct port on remote server

This example deals with a server listening to ssh on a port other than 22.

Using a rsync workflow file: .github/workflows/rsync.yml, we modify the ssh_options input to have the -p 2222 option:

- name: Deploy to server
  id: deploy
  uses: Pendect/[email protected]
  env:
    DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
  with:
    flags: '-avzr --delete'
    options: ''
    ssh_options: '-p 2222'
    src: 'public/'
    dest: '[email protected]:/var/www/server.com'

- name: Display status from deploy
  run: echo "${{ steps.deploy.outputs.status }}"

Changes

v1.1.0 (2019-12-05)

  • Add support to distinct remote port [ericof]

v1.0 (2019-11-1)

  • Initial release of Pendect/action-rsyncer [ericof]

About

Pendect is reshaping the way you navigate your daily flood of news.

Stay up to date with news events across the globe and be a part in the fight against fake news.

Follow us

pendecthq on twitter

About

Rsync GitHub Action

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 53.6%
  • Dockerfile 46.4%