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

GitHub Action

Setup SSH

v1.1.1

Setup SSH

terminal

Setup SSH

Setup private key and add host to known hosts

Installation

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

              

- name: Setup SSH

uses: kielabokkie/ssh-key-and-known-hosts-action@v1.1.1

Learn more about this action in kielabokkie/ssh-key-and-known-hosts-action

Choose a version

Setup SSH Github Action

This action adds a SSH key and adds a given hostname or IP address to the known hosts file for external server access. It was heavily inspired by atymic/deployer-php-action.

You can run this action before copying files to an external server using scp or rsync for example.

Inputs

  • ssh-private-key

Required Private key required to access the host.

  • ssh-host

Required Hostname or IP address to add to the known hosts file.

  • ssh-port

Optional Port for key-scanning the server.

Example usage

uses: kielabokkie/ssh-key-and-known-hosts-action@v1
with:
  ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
  ssh-host: your-server.com