FTP-Deploy-Action icon indicating copy to clipboard operation
FTP-Deploy-Action copied to clipboard

How to keep file or folder on server if it is removed removed from repo

Open kuba-cz opened this issue 2 years ago • 0 comments

I removed folder (with 1 file) from github repo (git rm --cached) I need these objects to stay on the server, but I do not need to track them and change anymore.

So far there was tracking, and the ftp-deploy thinks that the file/folder is not in repo anymore, so it must be deleted from server.

How can I delete the "history" from ftp-deploy and keep going for current files in github repo. I do not want to use "exclude" option, thus it does not work. I test it only now by dry-run. I see still removing folder "/web/wp-content/plugins" in the dry-run log. This is a problem. I need to keep it on server.

My Action Config

on: push
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/checkout@v2
    
    - name: 📂 Sync files
      uses: SamKirkland/[email protected]
      with:
        server: ftp.server.com
        username: user
        password: ${{ secrets.ftp_password }}
        local-dir: ./web/
        server-dir: web/
        dry-run: true

My Action Log

Last published on 📅 Friday, August 19, 2022, 8:[21](https://github.com/Behej-Podebrady/web/runs/7916778835?check_suite_focus=true#step:3:22) AM
----------------------------------------------------------------
Local Files:	61
Server Files:	63
----------------------------------------------------------------
Calculating differences between client & server
----------------------------------------------------------------
🔁 File replace: start/index.html
🔁 File replace: start/style.css
📁 Delete: wp-content/plugins    

....
...
⚖️  File content is the same, doing nothing: wp-content/themes/index.php
----------------------------------------------------------------
Making changes to 3 files/folders to sync server state
Uploading: 0 B -- Deleting: 28 B -- Replacing: 14.9 kB
----------------------------------------------------------------
replacing "start/index.html"
replacing "start/style.css"
removing folder "/web/wp-content/plugins"
----------------------------------------------------------------
🎉 Sync complete. Saving current server state to "web/.ftp-deploy-sync-state.json"
----------------------------------------------------------------
Time spent hashing: 41 milliseconds
Time spent connecting to server: 1.9 seconds
Time spent deploying: 1 millisecond (13.7 MB/second)
  - changing dirs: [25](https://github.com/......
  - logging: 4 milliseconds
----------------------------------------------------------------
Total time: 2.8 seconds
----------------------------------------------------------------

kuba-cz avatar Aug 19 '22 11:08 kuba-cz