From 83bf24a942e928be1f3a4c2cb098243795371767 Mon Sep 17 00:00:00 2001 From: Sebastian Popp Date: Wed, 4 Sep 2019 22:29:00 +0200 Subject: [PATCH] add action --- Dockerfile | 11 +++++++++++ action.yml | 27 +++++++++++++++++++++++++++ entrypoint.sh | 5 +++++ 3 files changed, 43 insertions(+) create mode 100644 Dockerfile create mode 100644 action.yml create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..294f86c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:3.10 + +LABEL version="1.0.0" +LABEL repository="https://github.com/sebastianpopp/ftp-action" +LABEL homepage="https://github.com/sebastianpopp/ftp-action" +LABEL maintainer="Sebastian Popp " + +RUN apk --no-cache add lftp + +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..23b31df --- /dev/null +++ b/action.yml @@ -0,0 +1,27 @@ +name: 'FTP Action' +description: 'Mirrors a directory with a FTP server.' +author: 'Sebastian Popp ' +inputs: + host: + description: 'FTP host' + required: true + user: + description: 'FTP user' + required: true + password: + description: 'FTP password' + required: true + localDir: + description: 'Local directory' + required: false + default: '.' + remoteDir: + description: 'Remote directory' + required: false + default: '.' +branding: + color: 'blue' + icon: 'upload' +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..f1b60df --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit"