appleboy / ssh-action

GitHub Actions for executing remote ssh commands.
https://github.com/marketplace/actions/ssh-remote-commands
MIT License
4.76k stars 577 forks source link

When I ssh to vps, I can't get vps environment variables #17

Closed silasol closed 4 years ago

silasol commented 4 years ago
  1. my actions

      - name: executing remote ssh commands using password
        uses: appleboy/ssh-action@master
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.PASSWORD }}
          port: ${{ secrets.PORT }}
          script: |
            bash ~/deploy.sh
  2. deploy.sh

    #! /bin/bash
    cd ~/myGo/src/x-api
    git pull
    go build -v
    pm2 start x
  3. ERROR

    
    ======CMD======
    21
    bash ~/deploy.sh
    22

23 ======END====== 24 err: From github.com:lushann/ 25 err: dbecbb0..00deb08 master -> origin/master 26 out: Updating dbecbb0..00deb08 27 out: Fast-forward 28 out: .github/workflows/go.yml | 11 ++++++++++- 29 out: 1 file changed, 10 insertions(+), 1 deletion(-) 30 err: /**/deploy.sh: line 4: go: command not found 31 err: //deploy.sh: line 5: pm2: command not found 32 2019/12/*** 08:30:26 Process exited with status 127 33

[error]Docker run failed with exit code 1



when I exec deploy.sh with ssh on my terminal, it's all fine. But when I use ssh-action , error will happen.

what should I do ?
SimonSun1988 commented 4 years ago

sorry, can i ask you how to fix this error?