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"