From b2b980a96fb0415d381a435c05918630abc2debd Mon Sep 17 00:00:00 2001 From: srueda99 Date: Mon, 18 Apr 2022 13:48:13 -0500 Subject: [PATCH] Changes on entrypoint --- .github/workflows/cicd.yml | 3 ++- README.md | 10 +++++----- entrypoint.sh | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 07d6558..1ab18b0 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -10,10 +10,11 @@ jobs: - name: Copy using key id: key-job - uses: srueda99/scp-action@latest + uses: srueda99/scp-action@v4 with: port: 22 host: ${{ secrets.SERVER_ADDRESS }} + origin: "./*" destination: "/home/${{ secrets.SERVER_USERNAME }}/" username: ${{ secrets.SERVER_USERNAME }} key: ${{ secrets.SERVER_KEY }} \ No newline at end of file diff --git a/README.md b/README.md index 8152a01..9cb4794 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ You must give: - 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 `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. @@ -25,7 +25,7 @@ Use Github secrets to give these parameters. **With password** ``` name: copy using password -uses: srueda99/scp-action@v3 +uses: srueda99/scp-action@v4 with: port: 22 host: ${{ secrets.SERVER_ADDRESS }} @@ -37,7 +37,7 @@ with: **With key** ``` name: copy using key -uses: srueda99/scp-action@v3 +uses: srueda99/scp-action@v4 with: port: 22 host: ${{ secrets.SERVER_ADDRESS }} @@ -49,7 +49,7 @@ with: **With origin folder** ``` name: copy using password -uses: srueda99/scp-action@v3 +uses: srueda99/scp-action@v4 with: port: 22 host: ${{ secrets.SERVER_ADDRESS }} @@ -62,7 +62,7 @@ with: **With passphrase** ``` name: copy using key -uses: srueda99/scp-action@v3 +uses: srueda99/scp-action@v4 with: port: 22 host: ${{ secrets.SERVER_ADDRESS }} diff --git a/entrypoint.sh b/entrypoint.sh index 50155f1..336baa6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,14 +2,14 @@ # Checking if the key input is not empty if [[ "$INPUT_KEY" ]]; then - # If it is not emty, it uses the key for the SCP + # If it is not empty, it uses the key for the SCP echo -e "${INPUT_KEY}" > key # Creates a file with the key content chmod 400 key # Set the key as Read-Only echo "Trying SCP process with SSH key" # Runs the SCP command scp -P $INPUT_PORT -o StrictHostKeyChecking=no -i key $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION" else - # If the keyis emty, it uses the password for the SCP + # If the keyis empty, it uses the password for the SCP echo "Trying SCP process with password" # Runs the SCP command sshpass -p $INPUT_PASSWORD scp -P $INPUT_PORT -o StrictHostKeyChecking=no $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"