Compare commits

..

No commits in common. "master" and "v1.0.0" have entirely different histories.

5 changed files with 23 additions and 30 deletions

View file

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

View file

@ -1,6 +1,6 @@
MIT License 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -1,27 +1,26 @@
# ftp-action # ftp-action
Automate copying your files via ftp using this GitHub action. Automate copying your files via FTP using this GitHub action.
## Example usage ## Example usage
``` ```
name: Deploy via ftp name: Upload via FTP
on: push on: push
jobs: jobs:
deploy: FTP-Action:
name: Deploy name: FTP-Action
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@master
- name: Upload ftp - name: Deploy FTP
uses: sebastianpopp/ftp-action@releases/v2 uses: sebastianpopp/ftp-action@master
with: with:
host: ${{ secrets.FTP_SERVER }} host: "ftp.example.com"
user: ${{ secrets.FTP_USERNAME }} user: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }} password: ${{ secrets.FTP_PASSWORD }}
localDir: "dist" localDir: "dist"
remoteDir: "www" remoteDir: "www"
options: "--delete --asci"
``` ```
## Input parameters ## Input parameters
@ -33,5 +32,3 @@ user | FTP username | Yes | N/A
password | FTP password | Yes | N/A password | FTP password | Yes | N/A
localDir | The local directory to copy | No | . localDir | The local directory to copy | No | .
remoteDir | The remote directory to copy to | No | . remoteDir | The remote directory to copy to | No | .
forceSsl | Force SSL encryption | No | false
options | Mirror command options | No | ''

View file

@ -1,6 +1,6 @@
name: 'ftp-action' name: 'FTP Action'
description: 'Mirrors a directory with a FTP server.'
author: 'Sebastian Popp <ftp-action@sebastianpopp.com>' author: 'Sebastian Popp <ftp-action@sebastianpopp.com>'
description: 'Automate copying your files via FTP using this GitHub action.'
inputs: inputs:
host: host:
description: 'FTP host' description: 'FTP host'
@ -11,10 +11,6 @@ inputs:
password: password:
description: 'FTP password' description: 'FTP password'
required: true required: true
forceSsl:
description: 'Force SSL encryption'
required: false
default: 'false'
localDir: localDir:
description: 'Local directory' description: 'Local directory'
required: false required: false
@ -23,13 +19,9 @@ inputs:
description: 'Remote directory' description: 'Remote directory'
required: false required: false
default: '.' default: '.'
options: branding:
description: 'Additional mirror command options' color: 'blue'
required: false icon: 'upload'
default: ''
runs: runs:
using: 'docker' using: 'docker'
image: 'Dockerfile' image: 'Dockerfile'
branding:
color: 'blue'
icon: 'upload-cloud'

View file

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