2.0 KiB
2.0 KiB
SCP ACTION
By SRUEDA99
Forked by shockrah with minor improvement in the entrypoint.sh
file for my own personal use.
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
hostwhich is the public address or the public DNS of the destination server. - The
usernamethat will be used in the remote server. - The
destinationfolder, where the content will be copied. - The
passwordfor the user or the privatekeyin case the connection is based on SSH keys.
Optional:
- The
originfolder is set by default as "./*" but you can also specify it. - The
portis set as 22 by default, you can also specify another one. - The
passphraseif necessary.
IMPORTANT
Use Github secrets to give these parameters.
Examples
With password
name: copy using password
uses: srueda99/scp-action@v12
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@v12
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@v12
with:
port: 22
host: ${{ secrets.SERVER_ADDRESS }}
origin: "./*"
destination: "/home/${{ secrets.SERVER_USERNAME }}/"
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
With passphrase
name: copy using key
uses: srueda99/scp-action@v12
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!