Skip to content

In the process of being transitioned to a node.js action.


Notifications You must be signed in to change notification settings


Folders and files

Last commit message
Last commit date

Latest commit



53 Commits

Repository files navigation

GitHub Action for Deploying via rsync Over ssh

Actions Status GitHubActions View Action

Sometimes, you might want to use rsync inside GitHub actions, such as for deploying static assets to some old school webserver over ssh. This is your action.

It allows you to transfer files from your working directory (/github/workspace) to some server using rsync over ssh. Helpfully, /github/workspace includes a copy of your repository source, as well as any build artefacts left behind by previous workflow steps (= other actions you ran before).


GitHub actions is still in limited public beta and advises against usage in production.

This action requires ssh private keys (see secrets), and may thus be vulnerable. The ssh authentification may need improvement (see issues).


This action requires two secrets to authenticate over ssh:


You get both of these from the server you interact with.

Remember to never commit these keys, but provide them through the GitHub UI (repository settings/secrets).

Environment Variables

This action requires three environment variables used to register the target server in $HOME/.ssh/known_hosts. This is to make sure that the action is talking to a trusted server.

known_hosts verification currently fails and is overriden, see issue 1.

  • HOST_NAME (the name of the server you wish to deploy to, such as
  • HOST_IP (the IP of the server you wish to deploy to, such as
  • HOST_FINGERPRINT (the fingerprint of the server you wish to deploy to, can have different formats)

The HOST_NAME is also used in the below required arguments.

Required Arguments

rsync requires:

  • SRC: source directory, relative path from /github/workspace
  • [USER@]HOST::DEST: target user (optional), target server, and directory from root on that target server. Remember you can reuse the environment variable $HOST_NAME.

For action rsync options, see in the source. For more options and documentation on rsync, see

Example Usage

action "Deploy with rsync" {
  uses = "maxheld83/rsync@v0.1.1"
  needs = "Write sha"
  secrets = [
  env = {
    HOST_NAME = ""
    HOST_IP = ""
    HOST_FINGERPRINT = "ecdsa-sha2-nistp256 AAAA..."
  args = [