appleboy / scp-action

GitHub Action that copy files and artifacts via SSH.
https://github.com/marketplace/actions/scp-command-to-transfer-files
MIT License
1.22k stars 136 forks source link

Creating folder name on remote server #124

Closed yousufkalim closed 1 year ago

yousufkalim commented 1 year ago

In this job, how can we stop build folder to be created inside the release path? I only want to copy the content of the build folder, not build folder itself


- name: Transfer files to server
      uses: appleboy/scp-action@master
      with:
        host: ${{ secrets[format('{0}_SERVER', env.NODE_ENV)] }}
        username: ${{ secrets[format('{0}_USER', env.NODE_ENV)] }}
        key: ${{ secrets[format('{0}_KEY', env.NODE_ENV)] }}
        rm: true
        source: 'build/*'
        target: ${{ env.RELEASE_PATH }}
`
appleboy commented 1 year ago

Add strip_components: 1 in your config.

  uses: appleboy/scp-action@master
  with:
    host: ${{ secrets[format('{0}_SERVER', env.NODE_ENV)] }}
    username: ${{ secrets[format('{0}_USER', env.NODE_ENV)] }}
    key: ${{ secrets[format('{0}_KEY', env.NODE_ENV)] }}
    rm: true
    source: 'build/*'
    target: ${{ env.RELEASE_PATH }}
+   strip_components: 1