commit 6e2f024bdc8d28cd0d3bec9609f1680cdb255e90 Author: Sebastian Rueda Date: Sun Apr 17 23:18:15 2022 -0500 Build commit diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..f7d44b0 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,19 @@ +name: Super SCP Action +on: [push] +jobs: + scp: + name: SCP Copy + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Copy using key + id: key-job + uses: srueda99/scp-action@v1 + with: + port: 22 + host: + target: "/home" + username: + key: \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8d03cec --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +# Runs on Alpine container, latest version. +FROM alpine +# Copy the script to the home directory of the container. +COPY entrypoint.sh /home/entrypoint.sh +# Grant executable permission on the script. +RUN ["chmod", "+x", "/home/entrypoint.sh"] +# Runs the script. +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..473a1a7 --- /dev/null +++ b/action.yml @@ -0,0 +1,40 @@ +name: 'SCP Action' +description: 'Copies the files from your repository to a remote host using SCP' +author: 'Sebastian Rueda' +inputs: + # $1 + port: + description: 'Port for SCP' + default: 22 + # $2 + host: + description: 'IP Address or DNS of your target host' + # $3 + target: + description: 'Destination route folder' + # $4 + username: + description: 'User for remote connection' + # $5 + password: + description: 'Password for the user' + # $6 + key: + description: 'Private SSH key' + # $7 + passphrase: + description: 'Passphrase for SSH key' +outputs: + time: + description: 'Returns the result' +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.port }} + - ${{ inputs.host }} + - ${{ inputs.target }} + - ${{ inputs.username }} + - ${{ inputs.password }} + - ${{ inputs.key }} + - ${{ inputs.passphrase }} \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..7b163a8 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/sh -l +