In order to offer Github login and deploying from a Github repository, you will need to set up an OAuth application in Github that will authorize reading Github user data and reading from/writing to Github repositories. In this guide, we assume you are setting up a Github integration for a Porter instance running on porter.example.com. Let's get started!

Step 1: Github OAuth Application Creation

πŸ“˜

Note: you can view the most up-to-date instructions for creating a Github OAuth app in the Github documentation.

Navigate to your organization settings page (alternately, you can navigate to your personal settings page) and select Developer Settings in the sidebar. Go to OAuth Apps and select New OAuth App. You can fill it in with the following fields:

  • Application name: Porter
  • Homepage URL: https://getporter.dev
  • Authorization callback URL: https://<your-domain>/api/oauth/github/callback

The registration form should look something like this:

After creating the OAuth application, select "Generate a new client secret" and store the secret value somewhere. You will need this for the next step.

Step 2: Update Porter Environment Variables

Add the following Github credentials to your Porter instance:

export GITHUB_CLIENT_ID=<your-github-client-id>
export GITHUB_CLIENT_SECRET=<your-github-client-secret>

πŸ“˜

Note: if you would only like to enable Github repository integrations, but you don't want to enable Github login, you can set the environment variable GITHUB_LOGIN_ENABLED=false.

Restart the Porter instance, and you will be given the option to log in with Github! This OAuth application will also enable you to add Github integrations to your Porter projects.