GitHub sync

Use version control with your applications

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. View complete setup instructions:

Using 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.

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

    • requirements.txt — Python packages installed in the application's Python environment

    • system-packages.txt — system packages installed in the application's Python environment

  • 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

Pulling changes from GitHub

Pulling changes from GitHub is coming soon. If you need this feature for your workflow, please contact us so we can prioritize the feature.

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.

You can clean up your baseten_apps repository by deleting the folder for the application, if desired.

Last updated