scp-action icon indicating copy to clipboard operation
scp-action copied to clipboard

Published path problem.

Open bbhxwl opened this issue 3 years ago • 4 comments

The directory uploaded to the server becomes /var/www/test/github/workspace/Release not /var/www/test

name: Upload theme to play-with-ghost.com | via SSH
      uses: appleboy/[email protected]
      with:
        host: "${{ secrets.NODE1 }}"
        port: ${{ secrets.SSH_PORT }}
        username: ${{ secrets.SSH_USERNAME }}
        password: ${{ secrets.PASSWORD }}
        source: "/home/runner/work/InnoImg/InnoImg/Release/*"
        target: "/var/www/test"

bbhxwl avatar Oct 09 '21 02:10 bbhxwl

Same problem here! Did you found a fix?

JoaoZanetti avatar Oct 13 '21 01:10 JoaoZanetti

Same problem here! Did you found a fix?

Not yet. We have to cooperate with the upload and then execute the Linux command.

bbhxwl avatar Oct 13 '21 01:10 bbhxwl

Had same problem. You need to use strip_components parameter as specified on #59

source: "/home/runner/work/InnoImg/InnoImg/Release/"
target: "/var/www/test"
strip_components: 6

felipeleivav avatar Nov 18 '21 11:11 felipeleivav

@bbhxwl I had the same issue as you. I believe we can close this.

LuisPeregrina avatar Feb 26 '22 04:02 LuisPeregrina

same problem.The folder path of the server is /home/solution-box/server/go/src/server/go/src/app,but is expected to be /home/solution-box/server/go/src/app,strip_components parameter not work

      - name: 向服务器传输go二进制可执行程序
        uses: appleboy/scp-action@master
        with:
          host: ${{ secrets.HOST }}  
          username: ${{ secrets.HUAWEI_USERNAME }} 
          port: ${{ secrets.SSH_PORT }} 
          password: ${{ secrets.HUAWEI_PASSWORD }}
          source: "./server/go/src/app" 
          target: "/home/solution-box/server/go/src/"
          overwrite: true
          strip_components: 3

catnuko avatar Nov 01 '22 13:11 catnuko

Thanks All, just use strip_components parameter to fix the path issue.

appleboy avatar Apr 09 '23 10:04 appleboy

Just leaving this here for reference: If you have a case where a dist is being generated and you want to export the contents (like I did for a next export), do the following

      - name: Copy static files
        uses: appleboy/[email protected]
        with:
          host: ${{ secrets.AWS_HOST }}
          username: ${{ secrets.AWS_USERNAME }}
          key: ${{ secrets.AWS_SECRET_KEY }}
          source: './dist/apps/website/exported/'
          target: ${{ secrets.HOST_VOLUME_PATH }}
          strip_components: 5

strip_components is 5 since the ./ is counted as well. All files in the exported folder were copied successfully @catnuko This might work for you

andyfaizan avatar Apr 24 '23 14:04 andyfaizan