You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -46,23 +46,29 @@ Note that you can explicitly exclude (or include) specific files or folders to b
46
46
47
47
### Setup
48
48
49
-
#### Pull workspace locally
49
+
#### 1. Initialize Git repository
50
50
51
-
For the Git repo to be representative of the entire workspace, it is recommended to set it up using the [Windmill CLI](../3_cli/index.mdx) before turning this option on.
51
+
First, create a Git repository to store your Windmill workspace:
52
52
53
-
Use [Windmill CLI](../3_cli/index.mdx) to pull the workspace locally:
Create an empty Git repository on your Git provider (GitHub, GitLab, etc.) without any initial files. Windmill will populate it automatically in the next step.
56
+
57
+
**Option B: Manual CLI setup**
58
+
59
+
For more control, you can set up the repository manually using the [Windmill CLI](../3_cli/index.mdx):
60
+
61
+
1. Use [Windmill CLI](../3_cli/index.mdx) to pull the workspace locally:
You now have your Windmill workspace on a GitHub repository. See the following section for an automated sync.
76
-
77
-
#### Setup in Windmill & GitHub token
81
+
You now have your Windmill workspace on a GitHub repository.
78
82
79
-
In Windmill, create a [git_repository](https://hub.windmill.dev/resource_types/135/git_repository) resource pointing to the GitHub repository and containing a [token](https://github.com/settings/tokens) (with Read-and-write on "Contents"). You URL should be `https://[USERNAME]:[TOKEN]@github.com/[ORG|USER]/[REPO_NAME].git`.
83
+
#### 2. Setup in Windmill
80
84
81
-
Add this resource to the workspace settings, in "Git sync" tab and `Save Git sync settings`.
85
+
1. Go to workspace settings → Git Sync tab
86
+
2. Click **+ Add connection**
87
+
3. Create or select a [git_repository](../../integrations/git_repository.mdx) resource pointing to your Git repository. You have two authentication options:
88
+
-**GitHub App**: Use the [GitHub App](../../integrations/git_repository.mdx#github-app) for simplified authentication and enhanced security
89
+
-**Personal Access Token**: Use a [token](https://github.com/settings/tokens) with Read-and-write on "Contents". Your URL should be `https://[USERNAME]:[TOKEN]@github.com/[ORG|USER]/[REPO_NAME].git`
90
+
4. Select sync mode ([sync mode or promotion mode](#sync-modes))
91
+
5. Complete the configuration of the connection and save
And that's it! Now, all scripts, flows apps, resources, variables, schedules, resource types and triggers located in the workspace and `f/`[folders](../../core_concepts/8_groups_and_folders/index.mdx) will be pushed to the Git repository.
95
+
If you chose Option A (empty repository), use the "Initialize Git repository" operation to automatically:
96
+
- Create the `wmill.yaml` configuration file with your filter settings
97
+
- Push the entire workspace content to the Git repository
98
+
99
+
If the repository already contains a `wmill.yaml` file, the settings will be automatically imported and applied to your workspace configuration.
86
100
87
-
You can filter on type if you don't want some items (e.g. variables) to be pushed to the Git repository.
101
+
**Configuration settings**: Git sync filter settings are pulled from the [`wmill.yaml`](../3_cli/sync.mdx#wmillyaml) file in your repository. Once the connection is saved, you can update settings by changing `wmill.yaml` and pulling the settings via the corresponding button.
88
102
89
-
Additionally, you can filter on [path](../../core_concepts/16_roles_and_permissions/index.mdx#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](../../core_concepts/8_groups_and_folders/index.mdx) will be synced.
If your repo requires signed commits, you can set up GPG on your Windmill instance.
94
109
@@ -120,7 +135,7 @@ All commits will now be signed and commited as the user matching the email addre
120
135
:::
121
136
122
137
#### Azure DevOps with Service Principal setup
123
-
In Microsoft Entra ID, create an application and a secret (also known as Service Principal - an identity used by applications to access Azure resources).
138
+
In Microsoft Entra ID, create an application and a secret (also known as Service Principal - an identity used by applications to access Azure resources).
124
139
Create an `azure` resource on your Windmill instance with the application's `client_id`, `client_secret` and `tenant_id`.
125
140
On Azure DevOps, add the application to the DevOps organization with the appropriate permissions.
126
141
In Git sync settings of your Windmill instance, define a new repository with URL:
Only scripts, flows and apps with their path matching one of the set 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.
137
152
By default everything in folders (with rule `f/**`) will be synced.
138
153
154
+
You can configure:
155
+
156
+
-**Include paths**: Primary patterns for what to sync (e.g., `f/**`)
157
+
-**Exclude paths**: Patterns to exclude after include checks
158
+
139
159
### Type filters
140
160
141
161
On top of the filter path [above](#path-filters), you can include only certain type of object to be synced with the Git repository.
-**Workspace settings** - Global workspace configuration
178
+
-**Encryption key** - Workspace encryption key
157
179
158
180
## Repositories to sync
159
181
160
182
The changes will be deployed to all the repositories set in the Git sync settings.
161
183
162
-
### Create one branch per deployed object
184
+
### Sync modes
185
+
186
+
You can choose between two sync modes for each repository:
187
+
188
+
#### Sync mode (default)
189
+
Changes are committed directly to the branch specified in the [git_repository](../../integrations/git_repository.mdx) resource. This is the standard mode for simple workspace synchronization.
190
+
191
+
#### Promotion mode
192
+
Windmill will create branches per deployed object based on its path, prefixed with 'wm_deploy/'. This enables advanced deployment workflows with pull requests and code review processes.
193
+
194
+
When promotion mode is enabled, you can choose to:
195
+
-**Create one branch per deployed object** (default)
196
+
-**Group deployed objects by folder**: Create a branch per folder containing objects being deployed instead
197
+
198
+
You can configure promotion-specific sync behavior using `promotionOverrides` in your [`wmill.yaml`](../3_cli/sync.mdx#wmillyaml) file. This allows different filter settings when promoting changes to specific branches.
163
199
164
-
If set, Windmill will create a unique branch per object being pushed based on its path, prefixed with 'wm_deploy/'.
200
+
This promotion mode is used to [deploy to a prod workspace using a git workflow](#git-sync---item-mode-deploy-to-prod-using-a-git-workflow).
165
201
166
-
It is used to [deploy to a prod workspace using a git workflow](#git-sync---item-mode-deploy-to-prod-using-a-git-workflow).
202
+
## Repository operations
167
203
168
-
### Group deployed objects by folder
204
+
Each configured repository supports several operations:
169
205
170
-
Instead of creating a branch per object, Windmill will create a branch per folder containing objects being deployed.
206
+
-**Test connection**: Verify repository access and credentials
207
+
-**Preview changes**: Perform a dry-run to see what would be synced
208
+
-**Push to repository**: Send workspace content to git repository
209
+
-**Pull from repository**: Get changes from git repository to workspace
210
+
-**Pull settings**: Get only wmill.yaml configuration changes
211
+
-**Initialize repository**: Set up new git repository with Windmill structure
212
+
213
+
## wmill.yaml integration
214
+
215
+
Git sync settings can be controlled via the [`wmill.yaml`](../3_cli/sync.mdx#wmillyaml) file in your repository root. This enables:
216
+
217
+
-**CLI compatibility**: Settings configured in the UI are compatible with [Windmill CLI](../3_cli/index.mdx)
218
+
-**Version-controlled configuration**: Your sync settings are stored in git alongside your code
219
+
-**Branch-specific overrides**: Different sync behavior per git branch
220
+
-**Promotion-specific settings**: Special configuration for deployment workflows
221
+
222
+
The frontend will detect existing `wmill.yaml` files and merge settings appropriately.
171
223
172
224
## Exclude specific types for this repository only
173
225
174
-
You can exclude specific types (scripts, flows, apps, folders) per repository.
226
+
You can exclude specific types per repository, overriding the global workspace filters.
175
227
176
228
## Git sync - Item mode: Deploy to prod using a git workflow
177
229
@@ -210,4 +262,4 @@ More details at:
210
262
description="Install the Windmill GitHub app to simplify setting up Git sync"
0 commit comments