Learning paths / Deploy on ComputeSphere / Deploy from a repository

Connecting GitHub

Reading · 5 min · Module 3, lesson 1 of 657 min left in this module

Module 3 · Deploy from a repositoryLesson 1 of 6

Goal: Connect a GitHub repository to ComputeSphere with access to only the repositories it needs.

Key idea

ComputeSphere reads your code through the ComputeSphere GitHub App. You install it on your GitHub account or organization and choose exactly which repositories it can see.

So far you've deployed images someone else built. From here on, ComputeSphere builds your app from its source code, and that starts with letting it read your repository.

How the connection works

  • It's an app install, not your password. You can see and revoke it any time in GitHub's settings.
  • You choose the scope: all repositories, or only the ones you pick. Pick only the ones you'll deploy.
  • It works for private repositories, because you granted access explicitly.

GitHub is the Git provider ComputeSphere supports today.

Connect a repository

  1. In the console, open your account settings and go to Connections. (Starting a new service from a Git repository leads to the same place.)
  2. Choose Add connection, then Connect next to GitHub. A GitHub window asks where to install the ComputeSphere app.
  3. Choose your account or organization, then Only select repositories, and pick the repository. The window closes when the connection is made.
  4. Back in ComputeSphere, choose the repository and the branch to build from.

If you install on an organization, an organization owner may need to approve it.

Least access, from the start

An integration only needs what it deploys. When you add a project later, add that one repository to the app's list in GitHub instead of widening access to everything.

In the next lab you'll fork a sample: that makes your own copy of someone else's repository under your GitHub account. Add the fork, not the original, to the app's list.

Changed your mind? Removing access

Remove a repository from the app's list, or uninstall the app, in GitHub under your account or organization's application settings. ComputeSphere loses access immediately. Services already running keep running on the images they were built from.

Check yourself

You're about to deploy one repository from your organization, which has forty. What do you grant the ComputeSphere app?

In the docs