Compare commits

..

15 commits

Author SHA1 Message Date
hsimah
ca3f8d253d
Feature/add additional opts (#17)
* Update entrypoint.sh

* Update action.yml

* Update README.md

* Update entrypoint.sh

* pass through additional mirror options

* restore meta-data
2021-01-31 20:42:23 +01:00
Sebastian Popp
eb75c5cb29 update readme and license 2020-03-16 10:45:32 +01:00
Sebastian Popp
1204235acf use latest alpine image 2020-03-16 10:01:41 +01:00
Sebastian Popp
ce7da30e09
Merge pull request #5 from ChrisDoernen/master
Add input parameter to enforce ssl encryption
2020-03-16 09:46:50 +01:00
Christian Dörnen
169e275151
Default values should be a string 2020-03-09 20:07:47 +01:00
ChrisDoernen
acf64d3524 Add input parameter to enforce ssl encryption 2020-03-05 21:34:50 +01:00
Sebastian Popp
60e94deadd add new releases/v1 branch to readme 2019-11-16 18:45:24 +01:00
Sebastian Popp
73cab2a2cd
Merge pull request #1 from thijsniks/master
- Excluding Git history
- Made the server variable a secret
- Continue when possible
- Deference symbolic links
- Verbose bash commands
2019-11-16 18:35:20 +01:00
Thijs Niks
5b5c1425a2 Revert "Added bash feedback"
This reverts commit 098896f8ae.
2019-11-15 17:48:52 -08:00
Thijs Niks
098896f8ae Added bash feedback 2019-11-14 21:05:33 -08:00
Thijs Niks
49423c5463 Verbose bash commands 2019-11-14 20:54:10 -08:00
Thijs Niks
890fde3763 Deference symbolic links 2019-11-14 20:52:48 -08:00
Thijs Niks
0dcdfc242f Continue when possible 2019-11-14 20:52:08 -08:00
Thijs Niks
e46bbab164 Made the server variable a secret 2019-11-14 20:49:02 -08:00
Thijs Niks
12afc55717 Excluding Git history
Comparing all Git files on every action takes up time and I’m assuming people don’t need the Git history to be available on their FTP server
2019-11-14 16:21:14 -08:00
5 changed files with 30 additions and 23 deletions

View file

@ -1,11 +1,9 @@
FROM alpine:3.10 FROM alpine:3.11
LABEL version="1.0.0" COPY LICENSE README.md /
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) 2019 Sebastian Popp Copyright (c) 2020 Sebastian Popp and contributors
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,26 +1,27 @@
# 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: Upload via FTP name: Deploy via ftp
on: push on: push
jobs: jobs:
FTP-Action: deploy:
name: FTP-Action name: Deploy
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@v2
- name: Deploy FTP - name: Upload ftp
uses: sebastianpopp/ftp-action@master uses: sebastianpopp/ftp-action@releases/v2
with: with:
host: "ftp.example.com" host: ${{ secrets.FTP_SERVER }}
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
@ -32,3 +33,5 @@ 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,6 +11,10 @@ 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
@ -19,9 +23,13 @@ inputs:
description: 'Remote directory' description: 'Remote directory'
required: false required: false
default: '.' default: '.'
branding: options:
color: 'blue' description: 'Additional mirror command options'
icon: 'upload' required: false
default: ''
runs: runs:
using: 'docker' using: 'docker'
image: 'Dockerfile' image: 'Dockerfile'
branding:
color: 'blue'
icon: 'upload-cloud'

View file

@ -1,5 +1,3 @@
#!/bin/sh #!/bin/sh -l
set -e 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"
lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror -R $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit"