Skip to content
terminal

GitHub Action

SSH and SCP Setup

v0.1.2 Latest version

SSH and SCP Setup

terminal

SSH and SCP Setup

Executing remote ssh and scp commands

Installation

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

              

- name: SSH and SCP Setup

uses: alinz/[email protected]

Learn more about this action in alinz/ssh-scp-action

Choose a version

SSH and SCP Setup in GITHUB's Action

Setup ssh agent for both ssh and scp. Script can be run before and after scp operation has been completed

USAGE

- name: Operations
  uses: alinz/ssh-scp-action@master
  env:
    HELLO: cool
    MESSAGE: hello world
  with:
    key: ${{ secrets.SSH_KEY }}
    host: example.com
    port: 22
    user: john
    # runs this on remove server
    ssh_before: |
      rm -rf sample1.dat sample2.dat
      echo $HELLO
      echo $MESSAGE
      ls -lath

    # then uploads these 2 files
    scp: |
      sample1.txt [email protected]:~/sample1.dat
      sample2.txt [email protected]:~/sample2.dat

    # then run these commands
    ssh_after: |
      echo $HELLO
      echo $MESSAGE
      ls -lath