Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
copy

GitHub Action

Copy via ssh

v0.5.3

Copy via ssh

copy

Copy via ssh

Github Action to copy a folder to a remote server using SSH

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Copy via ssh

uses: garygrossgarten/[email protected]

Learn more about this action in garygrossgarten/github-action-scp

Choose a version

GitHub Action SCP

Simple GitHub Action to copy a folder to a remote server using SSH. This is working with the latest GitHub Actions.

✨ Example Usage

Example using OpenSSH encrypted private key

- name: copy via scp
  uses: garygrossgarten/github-action-scp@release
  with:
    local: www
    remote: ./
    host: ${{ secrets.HOST }}
    username: garygrossgarten
    passphrase: ${{ secrets.PASSPHRASE }}
    privateKey: ${{ secrets.PRIVATE_KEY}}

🔐 Set your secrets here: https://github.com/USERNAME/REPO/settings/secrets.

Check out the workflow example for a minimalistic yaml workflow in GitHub Actions.

Result

result of example ssh workflow

Options

  • local - string - Path to local folder you want to copy. required

  • remote - string - Path to folder to copy the contents to. required

  • host - string - Hostname or IP address of the server. Default: 'localhost'

  • port - integer - Port number of the server. Default: 22

  • username - string - Username for authentication. Default: (none)

  • password - string - Password for password-based user authentication. Default: (none)

  • privateKey - mixed - Buffer or string that contains a private key for either key-based or hostbased user authentication (OpenSSH format). Default: (none)

  • passphrase - string - For an encrypted private key, this is the passphrase used to decrypt it. Default: (none)

  • tryKeyboard - boolean - Try keyboard-interactive user authentication if primary user authentication method fails. Default: false

Development


This thing is build using Typescript and ssh2 (via node-ssh). 🚀