GitHub integration
Use version control with your applications
GitHub sync is a feature on paid plans and is not enabled by default. Upgrade to a paid Baseten plan to enable this feature in your Baseten workspace.
Your workspace must also have the draft environment enabled.

Setting up the GitHub integration

In order to use GitHub sync, you must first enable the GitHub integration under the "Integrations" tab of the workspace settings. You must be a workspace admin to complete this action.
Click the "Connect" button to get started. You will be redirected to GitHub to connect the integration.
Description of the Baseten app on GitHub
Click "Install" to continue. You'll be prompted to choose an account or organization to install the integration with.
The integration works with both personal GitHub accounts and GitHub organizations. This documentation assumes you're connecting your Baseten workspace to a GitHub organization, but the steps are the same for connecting to personal accounts.
Finally, you'll be asked to authorize the integration. It doesn't matter which repositories you select as the integration will create its own baseten_apps repository. Here's why we ask for certain permissions:
  • Administration: Read and Write — Used to create the baseten_apps repository
  • Content: Read and Write — Used to clone, commit and push to the baseten_apps repository
To enable the integration, click "Install & Authorize" and you'll be redirected back to your Baseten workspace. The integration will now show as connected.
As the integration is enabled, a new repository called baseten_apps has been created inside your GitHub organization.
baseten_apps on GitHub

Disabling the GitHub integration

You can turn off the GitHub integration either from clicking the “Disconnect” button on the Integrations tab of your workspace settings in Baseten or in GitHub through the “Applications” section of your personal account or organization settings.

GitHub sync

When GitHub sync is enabled for an application, every time a new version of the application is published, the application's resources are pushed to your baseten_apps git repository. The main branch always stays in sync with the version of your apps in production.
We don't support syncing any changes made via git or GitHub back to your Baseten application. If you make any changes, for example to application code files, they will be overwritten the next time the application is published.

Turning on GitHub sync for an application

GitHub sync must be enabled for each application that you want to back up to GitHub. In each application, click the dropdown menu to the left of the environment selector, then click "Enable sync" and confirm in the modal.
Enable GitHub sync for an application
You'll notice the "Publish" button now says "Publish & sync." When you publish an application, it is also committed to GitHub with the version description as a commit message. Publishing will take a moment longer to run with sync enabled as it must also push to GitHub, so don't worry if it takes a few seconds after you confirm publishing the app.

What gets pushed to GitHub?

The following application resources are pushed to a folder named after your application in your baseten_apps GitHub repository:
  • Files — stored as text files with the appropriate extension like main.py
  • Worklets — each worklet corresponds to a YAML file representing the worklet graph
  • Views — each view corresponds to a YAML file representing the components and their position
  • configuration.yaml — a file containing the application's name and the id of the starting view
Additionally, these workspace resources are synced to a folder called Global within each app's folder:
  • requirements.txt — Python packages installed in the workspace environment
  • system_requirements.txt — system packages installed in the workspace environment
An example baseten_apps repository

Turning off GitHub sync for an application

To turn off GitHub sync, click the dropdown menu to the left of the environment selector, then click "Disable sync" and confirm in the modal.
Disable GitHub sync for an application
You can clean up your baseten_apps repository by deleting the folder for the application, if desired.

Importing repositories

Importing existing repositories into Baseten is coming soon.
Copy link
Outline
Setting up the GitHub integration
Disabling the GitHub integration
GitHub sync
Turning on GitHub sync for an application
What gets pushed to GitHub?
Turning off GitHub sync for an application
Importing repositories