Every project in Buddy is based on a Git repository. You can choose between GitHub, Bitbucket and GitLab providers, or Buddy’s fully-featured native hosting.
But what if you host your code elsewhere or only want to add a single repository without giving access to your whole GitHub account? Does it mean you won’t be able to take advantage of Buddy’s awesome features?
Not at all.
All you need to do is to use the Private repository option. Configuration is simple:
- Paste the URL to the repository
- Select the authorization method
- Configure a web hook and add it to the repository
This article will walk you through the process step on an example of a single GitHub repo. Let’s go!
Adding a project to Buddy
Let’s begin with setting up a project in Buddy:
- Sign up to Buddy with your GitHub profile
- Create a new project and select Your Private Git server as the provider
- Enter the Name for your project and paste the Repository URL
- Download or copy the SSH key – we’ll need that for the next part
- Click Create a new project when done
Authorizing Buddy in GitHub
Configuring deploy keys
Now ne need to add a deploy key so that Buddy can pull your repository to ship code:
- Select the repository that you want to synchronize in your GitHub profile
- Go to Settings → Deploy keys and click Add deploy key
- Paste the key that you copied from Buddy and enter its details
- Click Add key when done
Configuring web hooks
The last part is adding a web hook that will trigger deployments and update the list of commits in Buddy on changes to your repo:
- Switch to Buddy and go to the Code tab
- Click Refresh in the right column and copy the webhook
- Switch back to GitHub, go to Settings → Webhooks and click Add webhook
- Paste the webhook in the Payload URL and select Send me everything
- Click Add webhook when done
That’s it! You can use Buddy to automatically build, test and deploy code on every push to the selected branch in your private repo.
If you’re new to Buddy and would like to learn more about automating your delivery process, you can kick off with one of our guides:
- How to build and deploy front-end applications
- 5 ways to deploy PHP applications
- How to automate tests and deployments of Node.js apps
For the full list of guides click here.