Open pke opened 4 years ago
It seems when I disable strict host checking in the ecosystem file I am getting this result:
[PM2] Spawning PM2 daemon with pm2_home=/home/runner/.pm2
[PM2] PM2 Successfully daemonized
--> Deploying to production environment
--> on host MY.SERVER
fatal: HEAD does not point to a branch
○ deploying origin/master
○ executing pre-deploy-local
○ hook pre-deploy
Warning: Permanently added '[MY.SERVER]:36077,[45.10.26.70]:36077' (ECDSA) to the list of known hosts.
So the problem was that the HOST server that is deployed to was not in the known_hosts
file of the CI system (GitHub). Is my conclusion correct? And should that maybe added to the FAQ?
@pke
I had same problem in GitHub Actions and
I just updated ssh option
in my ecosystem.json.
"ssh_options": "StrictHostKeyChecking=no",
and it just works.
Sure this works and its a hack to circumvent security features ;)
On the server I can clone my repo using a ~/.ssh/config file just fine.
However during pm2 deploy via GH actions and using SSH-Agent GH Action I get those errors:
Deploy key and SSH-Agent Secret are properly setup. What could I check on the server to see whats going wrong? I also have GH in the
known_hosts
file like this: