webfactory / ssh-agent

GitHub Action to setup `ssh-agent` with a private key
MIT License
1.23k stars 256 forks source link

Example Usage is Unclear #22

Closed big-shadow closed 4 years ago

big-shadow commented 4 years ago

It's unclear how to issue a command on the host once an ssh connection is established. Please provide an example. In the example below, I'd like to run the php command on the host, rather than the action environment.

    - name: SSH Into Env
      uses: webfactory/ssh-agent@v0.2.0
      with:
        ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
    - name: Remotely Create Symbolic Link for Storage
      run: php artisan storage:link

image

big-shadow commented 4 years ago

The usage implied by the current documentation is invalid yaml.

image

mpdude commented 4 years ago

I am afraid you misunderstood the purpose of this action.

All it does is to start the ssh-agent, a background tool that keeps your private keys like on a keychain.

With this set up, you can then use ssh to connect to other hosts, or use tools like git that use ssh in the background themselves.

It seems you want to connect to another host. I am sure there are actions out there that help you with that, but I cannot recommend a particular one.

These actions will also need to access your keys, so you’ll probably want to run webfactory/ssh-agent first and then the second action.

big-shadow commented 4 years ago

@mpdude Gotcha. Thanks so much for clarifying. I'll investigate the options. I'm jumping through hoops just to create a symbolic link on my host! :P