Deploy with CI on FTP Server

Hello,

I ended up with the same question. Here is my current solution for the deploy stage:

deploy:
      image: mwienk/docker-lftp
      stage: deploy
      script:
        - lftp -u $FTP_USER,$FTP_PASS $HOST -e "set ftp:ssl-allow no ; mirror -e -R -p ./dist/ new/ ; quit" 
        - echo "deployment complete"
      # specify environment this job is using
      environment:
        name: staging
        url: http://ernaehrung.co.at/new/
      # needs artifacts from previous build
      dependencies:
        - build
      # only run on dev branch
      only:
        - dev

a nice explanation for the lftp statement parameters can be found here:


or in the official lftp docs:

I hope i could help you or somebody else who wants to create a gitlab job for uploading to a ftp directory.