DEV Community

Cover image for How to use Deploy Keys on GitHub?
SyedAsadRazaDevops
SyedAsadRazaDevops

Posted on • Edited on

How to use Deploy Keys on GitHub?

Have you ever noticed a menu, deep down inside the GitHub settings, called Deploy Key and wondered what that was for?

Well, today you'll finally know what that is for and how to use Deploy Keys in GitHub.

Configuring multiple SSH Deploy Keys on GitHub from one server. I wanted to use Deploy Keys on GitHub. Deploy Keys are pretty much read-only keys for your repositories. They can be found by going to your

Image description

I find them to be best practice for getting your code on your prod server as these only allow for servers to clone the code and not write to the repositories.

First create SSH KEY on server or using laptop where you deployed on, then go to repository I needed to clone onto my server, I then added the id_rsa.pub keys into the previously mentioned Deploy Key settings in repositories on GitHub.

PROS

  • Anyone with repo and server access an deploy.

  • No need to change local SSH setting.

  • Read-only by default, possible to give full access.

CONS

  • Grand access to a single repo.

  • Not protected by passphrase.

THANK YOU!

Top comments (0)