GitHub Integration
Connect a GitHub repository to deploy your app when commits are pushed to the default branch, FastAPI Cloud downloads the commit, builds it in the cloud, deploys it, and reports progress back to GitHub.
Requirements
Section titled “Requirements”- A FastAPI Cloud account with access to the app’s team
- A GitHub account
If your FastAPI app is in a subdirectory, set the Root Directory when creating the app from GitHub, or configure the Application Directory in app settings.
Create an App from GitHub
Section titled “Create an App from GitHub”To create a new app from a repository:
- Open the FastAPI Cloud dashboard
- Go to your team
- Create a new app. GitHub Repository is selected by default
- Connect your GitHub account if prompted
- Install or update the FastAPI Cloud GitHub App if prompted
- Select the GitHub account or organization. If it’s not listed, click Add GitHub Account
-
Select the repository
-
Set the Root Directory if your app is not at the repository root
- Click Create App
FastAPI Cloud creates the app with the repository connected. To start the first deployment, push to the default branch or click Deploy latest commit on the app’s Deployments page.
Connect GitHub to an Existing App
Section titled “Connect GitHub to an Existing App”To connect GitHub to an existing app:
- Open the app in the FastAPI Cloud dashboard
- Go to Settings
- Find Repository in the Build & Deploy section
- Click Connect
- Connect your GitHub account if prompted
- Install or update the FastAPI Cloud GitHub App if prompted
- Select the GitHub account or organization. If it’s not listed, click Add GitHub Account
- Select the repository
- Click Connect
Connecting the repository does not start a deployment. Push to the default branch to deploy. For an app with no deployments yet, Deploy latest commit is also available on its Deployments page.
To stop GitHub-triggered deployments for an app, disconnect the repository from the same Repository settings in the Build & Deploy section. Existing deployments keep running.
Deployments from GitHub
Section titled “Deployments from GitHub”FastAPI Cloud creates deployments from the connected repository when:
- A commit is pushed to the connected repository’s default branch
- You click Deploy latest commit on the Deployments page of an app with no deployments yet
The same GitHub repository can be connected to more than one FastAPI Cloud app. Each app can use build filters to choose which file changes trigger a build. Pushes that do not pass an app’s filters appear in its deployment history as Build Skipped.
Only pushes to the default branch trigger deployments. Pushes to other branches are ignored. Pull request preview deployments are not supported today.
Update Repository Access
Section titled “Update Repository Access”Change repository access from GitHub by editing the FastAPI Cloud GitHub App installation.
To revoke access entirely, remove the FastAPI Cloud GitHub App installation in GitHub. To stop deployments for one FastAPI Cloud app, disconnect the repository from that app’s Repository settings in the Build & Deploy section.
Troubleshooting
Section titled “Troubleshooting”I Do Not See a Repository
Section titled “I Do Not See a Repository”Check that:
- Your GitHub account is connected to FastAPI Cloud
- The FastAPI Cloud GitHub App is installed on the repository owner
- The GitHub App installation includes the repository
- You selected the correct personal account or organization in the repository picker
A Push Did Not Deploy
Section titled “A Push Did Not Deploy”Check that:
- The push was to the repository’s default branch
- The app is still connected to that repository
- The same commit was not already deployed for the app
- The changed files pass the app’s build filters; filtered pushes show as Build Skipped
- The app’s Application Directory points to the directory containing your FastAPI project
GitHub Status Is Missing or Stale
Section titled “GitHub Status Is Missing or Stale”Check the deployment in FastAPI Cloud first. If the deployment exists there but GitHub status is missing, confirm the GitHub App still has access to the repository.