Git Sync
From the workspace settings, you can set a git_repository resource on which the workspace will automatically commit and push scripts, flows and apps to the repository on each deploy.
For all details on Version Control in Windmill, see Version Control.
This video shows how to set up a Git repository for a workspace (Git Sync - workspace mode).
Git Sync - Workspace mode
All scripts, flows and apps located in the workspace will be pushed to the Git repository. You can filter Git Sync on path so that only the scripts, flows and apps with a matching path will be pushed to the Git repository. By default, everything in folders will be synced (with rule f/**
).
On each deployment, only the updated script/flow/app will be pushed to the remote Git repository.
This feature is Cloud & Enterprise Self-Hosted only.
Note that you can explicitly exclude (or include) specific files or folders to be taken into account with a wmill.yaml
file.
Pull workspace locally
For the Git repo to be representative of the entire workspace, it is recommended to set it up using the Windmill CLI before turning this option on.
Use Windmill CLI to pull the workspace locally:
wmill sync pull
Push workspace to GitHub
Create a Git repository (in the example, on GitHub).
Run the following commands from the git repo folder to push the initial workspace content to the remote:
git init
git remote add origin https://github.com/username/reponame.git
git add .
git commit -m 'Initial commit'
git push -u origin main
You now have your Windmill workspace on a GitHub repository. See the following section for an automated sync.
Setup in Windmill & GitHub token
In Windmill, create a git_repository resource pointing to the GitHub repository and containing a token (with Read-and-write on "Contents"). You URL should be https://[USERNAME]:[TOKEN]@github.com/[ORG|USER]/[REPO_NAME].git
.
Add this resource to the workspace settings, in "Git Sync" tab and Save Git sync settings
.
And that's it! Now, all scripts, flows apps, resources, variables, schedules and resource types located in the workspace and f/
folders will be pushed to the Git repository.
You can filter on type if you don't want some items (e.g. variables) to be pushed to the Git repository.
Additionally, you can filter on path, meaning only scripts, flows and apps with their path matching one of those filters will be synced to the Git repositories below. The filters allow ''' and '**' characters, with ''' matching any character allowed in paths until the next slash (/) and '**' matching anything including slashes. By default everything in folders will be synced.
Azure DevOps with Service Principal setup
In Microsoft Entra ID, create an application and a secret.
Create an azure
resource on your Windmill instance with the application's client_id
, client_secret
and tenant_id
.
On Azure DevOps, add the application to the DevOps organization with the appropriate permissions.
In Git Sync settings of your Windmill instance, define a new repository with URL:
https://AZURE_DEVOPS_TOKEN(<path_to_the_azure_resource>)@dev.azure.com/<organization>/<project>/_git/<repository>
Git Sync - Item mode: Deploy to Prod using a Git Workflow
This feature can be used alongside GiHub Actions to adopt a robust development process for your Windmill scripts, flows and apps, with for example a Staging Workspace making automatically PRs on a repo that pushes to a Prod workspace upon merge.
More details at: