I have a private repo and I'm trying to set my github actions so that when I push my code onto github, my workflow pulls the code from github to the server (ubuntu). For my secrets I have the host set to the IP address, username set as root, and a ssh key in private key.
When I run this the 'git pull' request fails and gives me an error: "fatal: could not read Username for 'https://github.com': No such device or address". Obviously it wants my github username and password which I can do when I manually run this in the command line, but how do I insert it for github actions?
name: Pull code, rebuild files and restart pm2 processes
on:
push:
branches: [master]
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Rebuild server
uses: garygrossgarten/github-action-ssh@release
with:
command: |
cd testwebsite.com
git pull
npm install
npx tsc
cd client
npm run build
pm2 restart server client
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
privateKey: ${{ secrets.PRIVATE_KEY}}