Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folder for the state file (sync-state.json) doesn't get created with "state-name" #468

Open
Micha-2409 opened this issue Jun 21, 2024 · 2 comments

Comments

@Micha-2409
Copy link

Request (Bug Description)
I am trying to use the setting "state-name" to save the sync-state-file in a certain folder, which is not existent at the initial push.
Is there a possibility to "create" that folder 'on the fly' if not already existent (like it is done for "server-dir") ?

My Action Config

on: push
name: Publish Website
jobs:
  web-deploy:
    name: 🔵 Web-Deploy
    runs-on: ubuntu-latest
    steps:
    
    - name: 🚚 Get latest code
      uses: actions/checkout@v4
    
    - name: 💾 Upload files
      uses: SamKirkland/[email protected]
      with:
        protocol: ftps
        server: ${{ secrets.FTP_HOST }}
        username: ${{ secrets.FTP_USER }}
        password: ${{ secrets.FTP_PASS }}
        server-dir: ${{ secrets.FTP_SERVERDIR }}
        
        state-name: .deployment/.deploy-ftp-sync-state.json
        #state-name: deployment/.deploy-ftp-sync-state.json   ## same error
        #state-name: /.deployment/.deploy-ftp-sync-state.json   ## same error
        #state-name: ./.deployment/.deploy-ftp-sync-state.json   ## same error
        
        exclude: |
          **/.git*
          **/.git*/**
          **/node_modules/**
          ./README.md
        log-level: verbose
        #dangerous-clean-slate: true
        #dry-run: true

My Action Log

   Error: ENOENT: no such file or directory, open './.deployment/.deploy-ftp-sync-state.json'

Further Question From A Friend 😇
Is there a way or an update about "excluding all files/folders, except certain ones" ?
I read the issues concerning this topic 201, 247, 292, 356 and 436 but couldn't find a clear answer (or a working scenario).

THANKS A LOT FOR YOUR GREAT WORK 🚀🚀🚀

@donnikitos
Copy link

donnikitos commented Sep 13, 2024

A possible workaround might be to create the folder manually before the upload?

on: push
name: Publish Website
jobs:
  web-deploy:
    name: 🔵 Web-Deploy
    runs-on: ubuntu-latest
    steps:
    
    - name: 🚚 Get latest code
      uses: actions/checkout@v4
    
    - name: Create sync folder
      run: mkdir .deployment
    
    - name: 💾 Upload files
      uses: SamKirkland/[email protected]
      with:
        protocol: ftps
        server: ${{ secrets.FTP_HOST }}
        username: ${{ secrets.FTP_USER }}
        password: ${{ secrets.FTP_PASS }}
        server-dir: ${{ secrets.FTP_SERVERDIR }}
        
        state-name: .deployment/.deploy-ftp-sync-state.json
        
        exclude: |
          **/.git*
          **/.git*/**
          **/node_modules/**
          ./README.md
        log-level: verbose

@Micha-2409
Copy link
Author

A possible workaround might be to create the folder manually before the upload?

Thank you for your answer.
Sure, this would be possible but is not what you want to do for every project you're uploading.
It is working for the "server-dir". So I thought there might be a way to get that done for the ".deploy-ftp-sync-state.json", too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants