initial commit

This commit is contained in:
Sebastian Hugentobler 2023-12-31 16:16:35 +01:00
commit fcca67b1fb
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
3 changed files with 35 additions and 0 deletions

9
Containerfile Normal file
View File

@ -0,0 +1,9 @@
FROM docker.io/alpine:3.19
RUN apk --no-cache add \
lftp \
openssh-client
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

22
action.yml Normal file
View File

@ -0,0 +1,22 @@
name: "Sftp Mirror"
description: "Mirror a folder to an sftp server."
inputs:
source:
description: "Source directory"
required: true
destination:
description: "Destination directory"
default: "/"
required: true
sftp-user:
description: "Sftp user name"
required: true
sftp-pw:
description: "Sftp password"
required: true
sftp-host:
description: "Sftp host"
required: true
runs:
using: "docker"
image: "Containerfile"

4
entrypoint.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
set -e
lftp -e "set sftp:auto-confirm yes; open -u $INPUT_SFTP_USER,$INPUT_SFTP_PW $SFTP_INPUT_HOST; mirror -v --no-perms --delete --reverse $INPUT_SOURCE $INPUT_DESTINATION; quit"