Skip to content

Commit 48a92f3

Browse files
authored
Merge pull request #433 from Staffbase/feat/create-deployment-passthrough
feat: pass through create-deployment input from gitops-github-action v7.2
2 parents 3310588 + 9f41d48 commit 48a92f3

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/template_gitops.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ on:
8080
required: false
8181
type: string
8282
default: "."
83+
create-deployment:
84+
required: false
85+
type: boolean
86+
default: false
87+
description: "Create GitHub Deployments on the source repository and write tracking annotations to the GitOps CRs"
8388
# waiting for: https://github.com/github-community/community/discussions/17554
8489
secrets:
8590
docker-username:
@@ -108,6 +113,7 @@ jobs:
108113
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
109114
permissions:
110115
contents: read
116+
deployments: write
111117

112118
env:
113119
USING_APP_CREDENTIALS: ${{ secrets.app-id != '' && secrets.private-key != '' }}
@@ -127,7 +133,7 @@ jobs:
127133

128134
- name: GitOps (build, push and deploy a new Docker image)
129135
id: gitops
130-
uses: Staffbase/gitops-github-action@4c47a273ab3456d6615dde95784239b5f5a1f49d # v7.1
136+
uses: Staffbase/gitops-github-action@2f0c03866d15503b7d1f1d4ca9929ec4bc9e7cf3 # v7.2
131137
with:
132138
docker-registry: ${{ inputs.docker-registry }}
133139
docker-username: ${{ secrets.docker-username }}
@@ -157,3 +163,5 @@ jobs:
157163
upwind-client-secret: ${{ secrets.upwind-client-secret }}
158164
upwind-organization-id: ${{ inputs.upwind-organization-id }}
159165
working-directory: ${{ inputs.working-directory }}
166+
create-deployment: ${{ inputs.create-deployment && 'true' || 'false' }}
167+
github-token: ${{ inputs.create-deployment && github.token || '' }}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ jobs:
245245
uses: Staffbase/gha-workflows/.github/workflows/template_gitops.yml@963c984dde02b0a8711f0d098aa9f8a7f2e50bca # v12.0.1
246246
permissions:
247247
contents: read
248+
deployments: write # only required when create-deployment is true
248249
with:
249250
# optional: host of the docker registry, default: "registry.staffbase.com"
250251
docker-registry: '<your-registry>'
@@ -284,6 +285,8 @@ jobs:
284285
# optional: files which should be updated for prod
285286
gitops-prod: |-
286287
your files
288+
# optional: create GitHub Deployments on the source repository and write tracking annotations to the GitOps CRs, default: false
289+
create-deployment: true
287290
# optional: defines the github runner for the gitops step if (e.g. ubuntu-24.04-arm for arm builds), default: ubuntu-24.04
288291
runs-on: ubuntu-24.04-arm
289292
# optional: Upwind.io client ID

0 commit comments

Comments
 (0)