add action

This commit is contained in:
Sebastian Popp 2019-09-04 22:29:00 +02:00
parent 37f3dddf43
commit 83bf24a942
3 changed files with 43 additions and 0 deletions

11
Dockerfile Normal file
View File

@ -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 <ftp-action@sebastianpopp.com>"
RUN apk --no-cache add lftp
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

27
action.yml Normal file
View File

@ -0,0 +1,27 @@
name: 'FTP Action'
description: 'Mirrors a directory with a FTP server.'
author: 'Sebastian Popp <ftp-action@sebastianpopp.com>'
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'

5
entrypoint.sh Executable file
View File

@ -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"