My own version of SCP action, mirrored off of Github repo
Go to file
2022-04-18 13:11:00 -05:00
.github/workflows SCP with key and password 2022-04-18 13:11:00 -05:00
action.yml SCP with key and password 2022-04-18 13:11:00 -05:00
Dockerfile Build commit 2022-04-17 23:18:15 -05:00
entrypoint.sh SCP with key and password 2022-04-18 13:11:00 -05:00
README.md SCP with key and password 2022-04-18 13:11:00 -05:00
test.txt SCP with key and password 2022-04-18 13:11:00 -05:00

SCP ACTION

By SRUEDA99

Overview

This action to copy the files from your repository to a remote server using SCP (Secure Copy Protocol).

How to use it

You must give:

  • The host which is the public address or the public DNS of the destination server.
  • The username that will be used in the remote server.
  • The destination folder, where the content will be copied.
  • The password for the user or the private key in case the connection is based on SSH keys. Optional:
  • The origin folder is set by default as "./*" but you can also specify it.
  • The port is set as 22 by default, you can also specify another one.
  • The passphrase if necessary.
**Important**
Use Github secrets to give these parameters.

Examples

With password

name: Copy using password
uses: srueda99/scp-action@v1
with:
    port: 22
    host: ${{ secrets.SERVER_ADDRESS }}
    destination: "/home/${{ secrets.SERVER_USERNAME }}/"
    username: ${{ secrets.SERVER_USERNAME }}
    password: ${{ secrets.SERVER_PASSWORD }}

With key

name: Copy using key
uses: srueda99/scp-action@v1
with:
    port: 22
    host: ${{ secrets.SERVER_ADDRESS }}
    destination: "/home/${{ secrets.SERVER_USERNAME }}/"
    username: ${{ secrets.SERVER_USERNAME }}
    key: ${{ secrets.SERVER_KEY }}

With origin folder

name: Copy using password
uses: srueda99/scp-action@v1
with:
    port: 22
    host: ${{ secrets.SERVER_ADDRESS }}
    origin: "/home/*"
    destination: "/home/${{ secrets.SERVER_USERNAME }}/"
    username: ${{ secrets.SERVER_USERNAME }}
    password: ${{ secrets.SERVER_PASSWORD }}

With passphrase

name: Copy using key
uses: srueda99/scp-action@v1
with:
    port: 22
    host: ${{ secrets.SERVER_ADDRESS }}
    destination: "/home/${{ secrets.SERVER_USERNAME }}/"
    username: ${{ secrets.SERVER_USERNAME }}
    key: ${{ secrets.SERVER_KEY }}
    passphrase: ${{ secrets.SERVER_PASSPHRASE }}

Enjoy it!!