Use version control with your applications
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:
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_appsgit 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.
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.
The following application resources are pushed to a folder named after your application in your
- Files — stored as text files with the appropriate extension like
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
An example baseten_apps repository
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_appsrepository by deleting the folder for the application, if desired.