DEV Community

Discussion on: Automate your Laravel app deployment with Github Actions

Collapse
 
precampio profile image
precamp-io

Thanks for your post. I have created two workflows one for staging one for prod. When I run $ git fetch

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Collapse
 
hammykl20 profile image
Hammy.kl20
Collapse
 
nablidev profile image
nablidev

@precampio as @hammykl20 pointed out you need to add github to the ssh known_hosts list like the following:

ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts

However, this is not enough as you have to also add your public key id_rsa.pub to your github account by going to your account's settings, clicking on "SSH and GPG keys," and then clicking "New SSH key."

Then just to be safe I would run the following two commands:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa