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
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,15 +108,27 @@ jobs:
108
108
109
109
### Deployment tracking annotations
110
110
111
-
Whenever the action updates a GitOps file, it stamps the following annotations onto the manifest's `metadata.annotations`:
111
+
By default (`deployment-annotations: 'true'`), whenever the action updates a GitOps file it stamps the following annotations onto the manifest's `metadata.annotations`:
112
112
113
113
| Annotation | Value |
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
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
-
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.
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. Set `deployment-annotations: 'false'` to skip them. The `deploy.staffbase.com` namespace is configurable via [`deployment-domain`](#inputs).
120
+
121
+
### Deployment tracking labels
122
+
123
+
Enabled by default (`deployment-labels: 'true'`). The same three values are stamped onto the **built Docker image** as OCI labels, using reverse-DNS keys — the [`deployment-domain`](#inputs) reversed (`deploy.staffbase.com` → `com.staffbase.deploy`):
124
+
125
+
| Label | Value |
126
+
|-------|-------|
127
+
| `com.staffbase.deploy.repositoryFullName` | The source repository in `owner/repo` form (`$GITHUB_REPOSITORY`) |
128
+
| `com.staffbase.deploy.commitSha` | The commit SHA being deployed (`$GITHUB_SHA`) |
129
+
| `com.staffbase.deploy.version` | The **non-timestamped** GitOps tag (same value as the `deploy.staffbase.com/version` annotation) |
130
+
131
+
> **Note:** labels are baked in at **build time**, so they are only applied on builds. Release (`v*`) and custom-tag runs that **retag** an existing image instead of rebuilding (see [Image tags](#image-tags--flux-image-automation)) do not get fresh labels — the retagged image keeps the labels from the branch build it was promoted from. This feature is independent of the annotations above; enable either, both, or neither.
120
132
121
133
## Inputs
122
134
@@ -138,6 +150,9 @@ These keys mirror the [Swarmia Deployment API](https://help.swarmia.com/settings
138
150
| `docker-build-platforms` | Sets the target platforms for build | linux/amd64 |
139
151
| `docker-build-provenance` | Generate [provenance](https://docs.docker.com/build/attestations/slsa-provenance/) attestation for the build | `false` |
140
152
| `docker-disable-retagging` | Disables retagging of existing images and run a new build instead | `false` |
| `deployment-domain` | Key namespace for deployment-tracking metadata. Used verbatim for annotation keys (`<domain>/...`) and reversed to reverse-DNS for label keys (`com.staffbase.deploy.*`) | `deploy.staffbase.com` |
155
+
| `deployment-labels` | Stamp deployment-tracking labels (`com.staffbase.deploy.*`) onto the built image. Only applied on builds, not on release/custom retags. See [Deployment tracking labels](#deployment-tracking-labels) | `true` |
141
156
| `gitops-organization` | GitHub Organization for GitOps | `Staffbase` |
142
157
| `gitops-repository` | GitHub Repository for GitOps | `mops` |
143
158
| `gitops-user` | GitHub User for GitOps | `Staffbot` |
Copy file name to clipboardExpand all lines: action.yml
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,18 @@ inputs:
62
62
description: 'Disable retagging of existing images'
63
63
required: false
64
64
default: 'false'
65
+
deployment-annotations:
66
+
description: 'Stamp deployment-tracking annotations (deploy.staffbase.com/repositoryFullName, /commitSha, /version) onto the updated GitOps manifests. Enabled by default; set to ''false'' to skip.'
67
+
required: false
68
+
default: 'true'
69
+
deployment-domain:
70
+
description: 'Domain used as the key namespace for deployment-tracking metadata. Applied verbatim to GitOps annotation keys (<domain>/repositoryFullName) and reversed to reverse-DNS for image label keys (deploy.staffbase.com -> com.staffbase.deploy.repositoryFullName).'
71
+
required: false
72
+
default: 'deploy.staffbase.com'
73
+
deployment-labels:
74
+
description: 'Stamp deployment-tracking labels (repositoryFullName, commitSha, version) onto the built Docker image. Enabled by default; only applied on builds, not on release/custom retags. Set to ''false'' to skip.'
0 commit comments