Overview
This guide explains how to create and configure a GitHub App for Orphelix.Setting up a GitHub App takes about 5-10 minutes and provides the most secure integration method.
Step 1: Create GitHub App
For Personal Account
1
Navigate to GitHub Settings
2
Click New GitHub App
Click the “New GitHub App” button
For Organization
1
Go to Organization Settings
Navigate to your organization → Settings → Developer settings → GitHub Apps
2
Click New GitHub App
Click the “New GitHub App” button
Step 2: Configure Basic Settings
Fill in the following fields in the GitHub App creation form:| Field | Value | Description |
|---|---|---|
| GitHub App name | Orphelix (or any unique name) | Display name for the app |
| Homepage URL | http://localhost:3000 | Your Orphelix URL |
| Callback URL | http://localhost:3000/api/github-app/callback | OAuth callback endpoint |
| Setup URL | Leave empty | Not needed |
| Webhook | ❌ Disable “Active” | We don’t use webhooks |
Step 3: Set Permissions
Under Repository permissions, configure the following:- Contents
- Pull requests
- Metadata
Access level:
Read and writeRequired for:- Reading YAML files from repository
- Creating/updating files for PRs
Summary of Permissions
Step 4: Create the App
1
Click Create GitHub App
Scroll to the bottom and click “Create GitHub App”
2
Confirm creation
You’ll be redirected to your new GitHub App’s settings page
Step 5: Install the App
1
Click Install App
In the left sidebar, click “Install App”
2
Choose account
Select your personal account or organization
3
Select repositories
Choose repository access:
- All repositories - Grant access to all current and future repos
- Only select repositories - Choose specific repos (recommended)
4
Click Install
Click “Install” to complete the installation
Step 6: Get Credentials
You need three credentials to configure Orphelix:1. App ID
1
Go to app settings
Navigate back to your GitHub App settings page
2
Find App ID
Look for “App ID” near the top of the page (e.g.,
123456)3
Copy App ID
Note this number - you’ll need it for
.env.local2. Client ID & Client Secret
1
Find Client ID
On the app settings page, locate “Client ID”
2
Generate Client Secret
Click “Generate a new client secret”
3
Copy immediately
3. Private Key
1
Scroll to Private keys section
On the app settings page, scroll down to “Private keys”
2
Generate key
Click “Generate a private key”
3
Save .pem file
A
.pem file will download automaticallyStep 7: Configure Environment Variables
Create or update.env.local in your Orphelix project root:
Converting Private Key
- macOS/Linux
- Windows
Make sure to keep the quotes around the private key value and preserve all line breaks
Generating NEXTAUTH_SECRET
Step 8: Verify Installation
1
Start Orphelix
2
Open Settings
Navigate to Settings page in Orphelix
3
Click GitHub Integration
Go to GitHub Integration section
4
Click Login with GitHub App
You should see a “Login with GitHub App” button
5
Authorize
Click the button and authorize the app
6
Select repository
After authorization, select a repository from the dropdown
7
Test YAML editor
Go to a deployment detail page and click “Edit YAML”You should see the Monaco editor with your deployment YAML!
Troubleshooting
App not showing in Settings
App not showing in Settings
Possible causes:
- Environment variables not set correctly
.env.localnot loaded (restart dev server)- NEXTAUTH_SECRET not generated
Authorization fails
Authorization fails
Cannot read repositories
Cannot read repositories
Possible causes:
- App not installed on repository
- Missing Contents permission
- Go to GitHub Settings → Applications → Installed GitHub Apps
- Click Configure on your app
- Verify repository access
Private key errors
Private key errors
Possible causes:
- Private key format incorrect
- Missing BEGIN/END lines
- Extra quotes or escaping
- Ensure private key includes
-----BEGIN RSA PRIVATE KEY-----and-----END RSA PRIVATE KEY----- - Use double quotes around the entire key
- Preserve line breaks
Production Deployment
For production, update these values:Security Best Practices
Private Key Storage
Private Key Storage
- Never commit
.env.localto git - Store private key in secure secret manager (production)
- Rotate keys periodically
Repository Access
Repository Access
- Only grant access to necessary repositories
- Use “Only select repositories” instead of “All repositories”
- Review access permissions regularly
Token Management
Token Management
- Tokens are stored in HTTP-only cookies
- Automatic refresh every 8 hours
- Revoke access from GitHub when not needed