I am using GitHub actions for ssh, and when I use it it says:
dial tcp ***: connect: connection refused
But when I manually ssh into the VM, it works.
Could you help me w it?
The actions script:
jobs:
build:
name: Compile and deploy application
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: echo test
I am trying to automate deploying my app to a vm, but I am not able to ssh into the vm using github actions.
But when I manually ssh into the VM, it works.
It depends from where you are doing this manual test.
I would add a step in your GitHub Action to run
curl -v telnet://${{ secrets.SSH_HOST }}:${{ secrets.SSH_PORT }}
That would check if the network route is opened/accessible from the GitHub runner, or if it is closed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With