milanmk / actions-file-deployer

Composite GitHub Action (Linux runner) for deploying repository content to remote server. Fast and customizable deployment with proxy support. Deploy only changed files or do full sync/mirror of repository content.
The Unlicense
62 stars 14 forks source link

Removing files and folders in delta mode doesn't work #3

Closed timocouckuyt closed 11 months ago

timocouckuyt commented 2 years ago

Hey @milanmk,

Thanks for your work on this action! I needed to explore the possibility to deploy code over SSH so I stumbled upon this action, which works great, partly thanks to the delta/full sync switch, awesome!

1 thing I noticed tho, is that when you create a testfolder with one testfile in it, that gets added perfectly fine, but if you remove the file from the testfolder and remove the folder too, in your repo, the removal of both file and folder doesn't work.

Could you check that, please?

Thanks a lot!

// T

KingMike920 commented 2 years ago

Hey @milanmk ,

thanks for your work on this action! I can confirm the issue of @timocouckuyt . I have the same problem, too. @timocouckuyt told that the problem is in delta-mode. I just figured out that this problem exists in both modes - delta and full-mode.

Just follow the steps to reproduce of @timocouckuyt .

It would be great if you can fix this for us! You did such a great action on github :). Many thanks for this!

ammar88 commented 2 years ago

Adding the --delete flag to the lftp mirror command would make this work for full sync mode.

timocouckuyt commented 2 years ago

@milanmk Did you get the chance of looking into this issue?

milanmk commented 2 years ago

I could reproduce this issue on my end. However, not sure what is causing it. Will post an update as soon as I find the fix for this issue.

milanmk commented 2 years ago

I have released version 1.10 with partial fix to this issue. Deleted files from repository are now being deleted properly from remote. However, the deleted folders from repository is still not deleted from remote (folder will be empty as all the files are deleted).

Fixing the folder deletion on remote is not a straightforward task as there is no easy way to get just the deleted folders from git diff. Will update this ticket if I find any clever solution to this issue.

FranckSCTV commented 1 year ago

@ammar88 @milanmk Sorry for asking such a dumb question but is the following config syntax correct when using LFTP? Doesn't seem to work so I'm obviously doing something wrong. (files aren't deleted on the server)

          sync: "full"
          ftp-mirror-options: "lftp --delete-first"
          debug: true
milanmk commented 1 year ago

@FranckSCTV It should not contain the literal "lftp" command itself, just the option parameters.

ftp-mirror-options: "--delete-first"
FranckSCTV commented 1 year ago

@milanmk Thank you! It actually worked that way. Really helped A LOT.