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
Copy file name to clipboardExpand all lines: README.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ Whenever the action updates a GitOps file, it stamps the following annotations o
114
114
|------------|-------|
115
115
| `deploy.staffbase.com/repositoryFullName` | The source repository in `owner/repo` form (`$GITHUB_REPOSITORY`) |
116
116
| `deploy.staffbase.com/commitSha` | The commit SHA being deployed (`$GITHUB_SHA`) |
117
-
| `deploy.staffbase.com/version` | The deployed image tag — `dev-<timestamp>-<short-sha>` on `dev`, `main-<timestamp>-<short-sha>` on `main`, `master-<timestamp>-<short-sha>` on `master` (the UTC timestamp is inserted by default; with `docker-tag-timestamp: 'false'` it falls back to `<prefix>-<short-sha>`), the version without the leading `v` on `v*` tag pushes, and the tag name on other tag pushes |
117
+
| `deploy.staffbase.com/version` | The image tag written to the GitOps repo — always the **non-timestamped** tag: `dev-<short-sha>`on `dev`, `main-<short-sha>` on `main`, `master-<short-sha>` on `master`, the version without the leading `v` on `v*` tag pushes, and the tag name on other tag pushes. See [GitOps tag](#gitops-tag) below |
118
118
119
119
These keys mirror the [Swarmia Deployment API](https://help.swarmia.com/settings/organization/configuring-deployments-in-swarmia) field names and are read by `flux-deployment-reporter` to report deployments to Swarmia once Flux finishes reconciling.
120
120
@@ -176,10 +176,27 @@ to fall back to the legacy `<prefix>-<short-sha>` shape.
176
176
177
177
> **Note:** with the timestamp enabled (the default) the build also pushes the plain
178
178
> `<prefix>-<short-sha>` tag alongside the timestamped one. That stable per-commit
179
-
> tag is what the release step retags into the version tag, so it must continue
179
+
> tag is what the release step retags into the version tag and what the action
180
+
> writes to the GitOps repo (see [GitOps tag](#gitops-tag)), so it must continue
180
181
> to exist. It does not match the `^<prefix>-[0-9]+-[0-9a-f]+$` filter below, so
181
182
> Flux ignores it.
182
183
184
+
### GitOps tag
185
+
186
+
The tag the action **builds and pushes** is the timestamped one (so Flux image
187
+
automation can sort it). The tag the action **writes to the external GitOps repo**
188
+
(`gitops-dev`/`gitops-stage`/`gitops-prod` files and the deployment annotations) is
189
+
always the **non-timestamped** tag — the stable `<prefix>-<short-sha>` alias for
190
+
branch builds, and the plain tag for `v*`/custom builds (which never carry a
191
+
timestamp).
192
+
193
+
This is deliberate and not configurable. When the action runs across separate
194
+
invocations — e.g. one step builds the image and a later step pushes and updates
195
+
GitOps — each invocation recomputes a *fresh* timestamp, so the timestamped tag
196
+
differs between them. The `<prefix>-<short-sha>` alias is deterministic, so the
197
+
GitOps reference stays consistent and always points at an image that was actually
198
+
pushed.
199
+
183
200
With the timestamp enabled, use one `ImagePolicy` per environment, filtering by prefix:
0 commit comments