Skip to content

Pendect/action-rsyncer

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 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 user@server.com:/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/action-rsyncer@v1.1.0
  env:
    DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
  with:
    flags: '-avzr --delete'
    options: ''
    ssh_options: ''
    src: 'public/'
    dest: 'user@server.com:/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/action-rsyncer@v1.1.0
  env:
    DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
  with:
    flags: '-avzr --delete'
    options: ''
    ssh_options: '-p 2222'
    src: 'public/'
    dest: 'user@server.com:/var/www/server.com'

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

Changes

v2.0.0 (2022-12-06)

  • Address the deprecation of save-state and set-output commands [taupecat]

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