airvzxf / ftp-deployment-action

FTP Deployment: This GitHub action copy the files via FTP from your Git project to your server in a specific path.
GNU General Public License v3.0
31 stars 7 forks source link

FTP Upload only newer files #19

Closed Dindoucha closed 4 months ago

Dindoucha commented 4 months ago

Is it possible to upload/rewrite only the files that are newer than the files in the server? I think this will boost the speed for example for a Laravel project I don't have to publish Vendor on each action call even if I just edited a controller thanks in advance

Dindoucha commented 4 months ago

I think that's not possible because when repo is cloned all files have date of clone time

airvzxf commented 4 months ago

If you like, we could talk and research about it; most important, we could experiment with your project to improve this behavior with my action (it will require time and effort). If you are interested, we could reopen this issue.

I found this information on Stack Overflow: Correct LFTP command to upload only updated files. Basically, it is possible with the arguments of LFTP, which is the application that I am using in my action because my action is a wrapper (middle man) between the user/GitHub and the LFTP.

https://linux.die.net/man/1/lftp

mirror [OPTS] [source [target]] Mirror specified source directory to local target directory. If target directory ends with a slash, the source base name is appended to target directory name. Source and/or target can be URLs pointing to directories. -n, --only-newer download only newer files (-c won't work)