Compare commits

...

10 Commits

Author SHA1 Message Date
144fd456ba Omit directory time setting 2024-09-28 15:53:20 -07:00
9733f66e78 removing random backslash 2024-09-28 15:33:35 -07:00
731c33a2e9 removing bash style checks 2024-09-28 14:56:34 -07:00
6333f32c32 More shells cript fixes 2024-09-28 14:46:41 -07:00
fd7c104073 Fixing flags in entrypoint 2024-09-28 14:39:26 -07:00
ca642a2f1c Bumping example version 2024-09-28 14:36:07 -07:00
37b4e77655 Updating branding 2024-09-28 14:33:11 -07:00
80ffad571c Bump version in example 2024-09-28 14:27:16 -07:00
83dc8139d6 renaming project 2024-09-28 14:24:58 -07:00
7585482de6 Fixing example in readme 2024-09-28 14:23:43 -07:00
3 changed files with 32 additions and 42 deletions

View File

@ -1,4 +1,4 @@
# Rsync Action
# Rsync Copy
***By `temper`***
@ -30,13 +30,13 @@ It is recommended to pass all sensitive values through `secrets`
```yaml
name: Copy single file
uses: tempersama/rsync-action@1.4
uses: tempersama/rsync-action@2.3
with:
host: ${{ secrets.host }}
source: html/
destination: /opt/nginx/website.com
username: ${{ secrets.username }}
key: ${{ secrets.SERVER_KEY }}
port: 2222
host: ${{ secrets.host }}
source: html/
destination: /opt/nginx/website.com
username: ${{ secrets.username }}
key: ${{ secrets.SERVER_KEY }}
port: 2222
```

View File

@ -1,30 +1,29 @@
name: 'Rsync Action'
name: 'Rsync Copy'
description: 'Copies the files from your repository to a remote host using rsync'
author: 'temper'
inputs:
# $1
host:
description: 'IP Address or DNS of your target host'
required: true
source:
description: 'Source route folder'
required: true
destination:
description: 'Destination route folder'
required: true
username:
description: 'User for remote connection'
required: true
key:
description: 'Private SSH key'
required: true
port:
description: 'Port for SCP'
default: 22
# $2
host:
description: 'IP Address or DNS of your target host'
# $3
source:
description: 'Source route folder'
default: "./*"
# $4
destination:
description: 'Destination route folder'
# $5
username:
description: 'User for remote connection'
# $7
key:
description: 'Private SSH key'
runs:
using: 'docker'
image: 'Dockerfile'
branding:
icon: 'send'
color: 'black'
icon: 'file-text'
color: 'purple'

View File

@ -1,24 +1,15 @@
#!/bin/sh -l -e
# Quick checks for missing parameters
rc=0
empty() { echo ERROR: $1 is empty }
[[ "$INPUT_HOST" ]] && empty host
[[ "$INPUT_SOURCE" ]] && empty source
[[ "$INPUT_DESTINATION" ]] && empty destination
[[ "$INPUT_USERNME" ]] && empty username
[[ "$INPUT_KEY" ]] && empty key
#!/bin/sh -l
set -e
echo -e "${INPUT_KEY}" > key
chmod 400 key
# TODO: make sure we are not just blindly using StrictHostKeyChecking=no
rsync \
-a -v \ --stats \
-a -v -O --stats \
-e "ssh -o StrictHostKeyChecking=no -i key" \
--port $INPUT_PORT \
--port "$INPUT_PORT" \
"$INPUT_SOURCE" \
"$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"