How to deploy a Node.js application using GitHub Actions and SFTP?

I am trying to deploy a Node.js application to my linode using GitHub actions and the SFTP protocol.

I have added an additional job to my GitHub Actions workflow YML file as follows:

deploy-via-sftp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: SFTP Deploy to Linode
uses: wlixcc/SFTP-Deploy-Action@v1.2.1
with:
username: ${{ secrets.LINODE_USER }}
server: ${{secrets.IP}}
port: 22
ssh_private_key: ${{ secrets.LINODE_SSH }}
local_path: ./* # using default path
remote_path: /home/quoterepo
# name of app is quoterepo
args: '-o ConnectTimeout=5'

However, when I push my latest code to my remote repository I receive the following error:

ssh: Could not resolve hostname : Name does not resolve
ssh start

Any ideas as to what is causing the problem?

Thanks!

1 Reply

My guess (because I don't have a clue about what you're doing) is that the process is trying to do domain-name resolution on an IP address and failing (maybe because of a bug). Try replacing server: ${{secrets.IP}} with server: ${{secrets.DOMAIN_NAME}}.

Also, I would hope that ssh_private_key: ${{ secrets.LINODE_SSH }} is a filename…and not your actual SSH private key! It would give me much pause to supply the text of my private key to some other entity in a configuration file. Private means private

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct