Skip to content

Github actions for executing commands and uploading files to remote server

License

Notifications You must be signed in to change notification settings

alinz/ssh-scp-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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