Skip to content
send

GitHub Action

FTP Mirror

v2 Latest version

FTP Mirror

send

FTP Mirror

Copy all the files and folders via FTP from your Git project to your server in a specific path, delete remote folder before

Installation

Copy and paste the following snippet into your .yml file.

              

- name: FTP Mirror

uses: modern-dev/ftp-mirror@v2

Learn more about this action in modern-dev/ftp-mirror

Choose a version

🚀 FTP Mirror

Syncs a local folder with a remote folder over FTP using GitHub Workflow.

📋 Usage

Create custom workflow for your project as per this doc. Read more about Encrypted Secrets here.

name: 🚀 Deploy
on:
  push:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      # Here is the deployment action
      - name: Upload from output to a remote server via FTP
        uses: modern-dev/ftp-mirror@v2
        with:
          server: ${{ secrets.FTP_SERVER }}
          user: ${{ secrets.FTP_USERNAME }}
          password: ${{ secrets.FTP_PASSWORD }}
          local_dir: "./output"
          remote_dir: "./http"
          delete: "false"
          exlude: "data/ cache/"

🔧 Settings

Option Description Required Default Example
server FTP Server. Yes N/A ftp.myserver.com
user FTP Username. Yes N/A [email protected]
password FTP Password. Yes N/A mystrongpassword
local_dir Local directory. No "./" "./public_html"
remote_dir Remote directory. No "./" "/www/user/home"
delete Delete all the files inside of the remote directory before the upload process. No false N/A
exclude Exclude matching files. No "" "data/ cache/"
exclude_glob Exclude matching files using glob pattern. No "" "*.bak"
max_retries Times that the lftp will be executed if an error occurred. No 10 N/A
no_symlinks Do not create symbolic links. No true N/A
ftp_ssl_allow FTP - Allow SSL encryption No false N/A
ftp_use_feat FTP - FEAT: Determining what extended features the FTP server supports. No false N/A
ftp_nop_interval FTP - Delay in seconds between NOOP commands when downloading tail of a file. No 2 N/A
net_max_retries NET - Maximum number of operation without success.
0 unlimited.
1 no retries.
No 1 N/A
net_persist_retries NET - Ignore hard errors.
When reply 5xx errors or there is too many users.
No 5 N/A
net_timeout NET - Sets the network protocol timeout. No 15s N/A
dns_max_retries DNS - 0 no limit trying to lookup an address otherwise try only this number of times. No 8 N/A
dns_fatal_timeout DNS - Time for DNS queries.
Set to "never" to disable.
No 10s N/A

More information in the official site for lftp - Manual pages

📗 License

Licensed under the MIT license.

Copyright (c) 2022 Bohdan Shtepan


modern-dev.com  ·  GitHub: @virtyaluk  ·  Twitter: @virtyaluk