Pendect / action-rsyncer

Rsync GitHub Action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Rsync GitHub Action

License:MIT License


Languages

Language:Shell 53.5%Language:Dockerfile 46.5%