Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/template_gitops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ on:
required: false
type: string
default: "."
create-deployment:
required: false
type: boolean
default: false
description: "Create GitHub Deployments on the source repository and write tracking annotations to the GitOps CRs"
# waiting for: https://github.com/github-community/community/discussions/17554
secrets:
docker-username:
Expand Down Expand Up @@ -108,6 +113,7 @@ jobs:
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
permissions:
contents: read
deployments: write

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

- name: GitOps (build, push and deploy a new Docker image)
id: gitops
uses: Staffbase/gitops-github-action@4c47a273ab3456d6615dde95784239b5f5a1f49d # v7.1
uses: Staffbase/gitops-github-action@2f0c03866d15503b7d1f1d4ca9929ec4bc9e7cf3 # v7.2
with:
docker-registry: ${{ inputs.docker-registry }}
docker-username: ${{ secrets.docker-username }}
Expand Down Expand Up @@ -157,3 +163,5 @@ jobs:
upwind-client-secret: ${{ secrets.upwind-client-secret }}
upwind-organization-id: ${{ inputs.upwind-organization-id }}
working-directory: ${{ inputs.working-directory }}
create-deployment: ${{ inputs.create-deployment && 'true' || 'false' }}
github-token: ${{ inputs.create-deployment && github.token || '' }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ jobs:
uses: Staffbase/gha-workflows/.github/workflows/template_gitops.yml@963c984dde02b0a8711f0d098aa9f8a7f2e50bca # v12.0.1
permissions:
contents: read
deployments: write # only required when create-deployment is true
with:
# optional: host of the docker registry, default: "registry.staffbase.com"
docker-registry: '<your-registry>'
Expand Down Expand Up @@ -284,6 +285,8 @@ jobs:
# optional: files which should be updated for prod
gitops-prod: |-
your files
# optional: create GitHub Deployments on the source repository and write tracking annotations to the GitOps CRs, default: false
create-deployment: true
# optional: defines the github runner for the gitops step if (e.g. ubuntu-24.04-arm for arm builds), default: ubuntu-24.04
runs-on: ubuntu-24.04-arm
# optional: Upwind.io client ID
Expand Down
Loading