diff --git a/Dockerfile b/Dockerfile index 145c391..294f86c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,11 @@ -FROM alpine:3.11 +FROM alpine:3.10 -COPY LICENSE README.md / +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/LICENSE b/LICENSE index c371d5f..a576e9d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Sebastian Popp and contributors +Copyright (c) 2019 Sebastian Popp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 50c4a78..5d7082a 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,26 @@ # ftp-action -Automate copying your files via ftp using this GitHub action. +Automate copying your files via FTP using this GitHub action. ## Example usage ``` -name: Deploy via ftp +name: Upload via FTP on: push jobs: - deploy: - name: Deploy + FTP-Action: + name: FTP-Action runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Upload ftp - uses: sebastianpopp/ftp-action@releases/v2 + - uses: actions/checkout@master + - name: Deploy FTP + uses: sebastianpopp/ftp-action@master with: - host: ${{ secrets.FTP_SERVER }} + host: "ftp.example.com" user: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} localDir: "dist" remoteDir: "www" - options: "--delete --asci" ``` ## Input parameters @@ -33,5 +32,3 @@ user | FTP username | Yes | N/A password | FTP password | Yes | N/A localDir | The local directory to copy | No | . remoteDir | The remote directory to copy to | No | . -forceSsl | Force SSL encryption | No | false -options | Mirror command options | No | '' diff --git a/action.yml b/action.yml index 6d362cb..23b31df 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,6 @@ -name: 'ftp-action' +name: 'FTP Action' +description: 'Mirrors a directory with a FTP server.' author: 'Sebastian Popp ' -description: 'Automate copying your files via FTP using this GitHub action.' inputs: host: description: 'FTP host' @@ -11,10 +11,6 @@ inputs: password: description: 'FTP password' required: true - forceSsl: - description: 'Force SSL encryption' - required: false - default: 'false' localDir: description: 'Local directory' required: false @@ -23,13 +19,9 @@ inputs: description: 'Remote directory' required: false default: '.' - options: - description: 'Additional mirror command options' - required: false - default: '' +branding: + color: 'blue' + icon: 'upload' runs: using: 'docker' image: 'Dockerfile' -branding: - color: 'blue' - icon: 'upload-cloud' diff --git a/entrypoint.sh b/entrypoint.sh index 45331f7..f1b60df 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,5 @@ -#!/bin/sh -l +#!/bin/sh -lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; mirror $INPUT_OPTIONS --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" +set -e + +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit"