I have my repo hooked up to Codeship which runs tests and then finally runs a script on my server via SSH:
ssh deploy@my.server '/var/www/deploy-script.sh'
On my server I have my deploy
user set up. I have that user's public key stored on my github account. I also have the codeship public key for my project stored in ~/.ssh/authorized_keys
.
Inside deploy-script.sh
, I'm navigating to the repo directory and then trying git pull
. Obviously, I need the latest code to be pulled down without a password as this is being run on a virtual machine on codeship. Codeship is apparently able to SSH into my server and run the deployment script, however the log is reporting:
> Pull updates from Github.
Permission denied (publickey).
fatal: Could not read from remote repository.
If I log into my server as the deploy
user and run the script fine, with the git pull
working correctly.
What am I missing? Why doesn't github allow access when it's codeship logging in as the deploy user rather than me?