Skip to content

feat: add create-deployment input for GitHub Deployment tracking#130

Draft
0x46616c6b wants to merge 1 commit intomainfrom
feat/create-deployment
Draft

feat: add create-deployment input for GitHub Deployment tracking#130
0x46616c6b wants to merge 1 commit intomainfrom
feat/create-deployment

Conversation

@0x46616c6b
Copy link
Copy Markdown
Contributor

Type of Change

  • Enhancement / new feature

Description

Add an opt-in create-deployment boolean input that creates GitHub Deployments on the source repository and writes tracking annotations to the Application CR in the mops overlay.

This enables the flux-deployment-reporter to directly identify and update the correct GitHub Deployment without image-to-repo mapping or tag parsing.

New inputs:

  • create-deployment (boolean, default false) — no breaking change
  • github-token — required when create-deployment is true, needs deployments: write permission

New output:

  • deployment-id — JSON map of environment to GitHub Deployment ID (e.g. {"prod-de1": "12345", "prod-us1": "67890"})

Behavior when create-deployment is true:

  • Creates a GitHub Deployment per target file/cluster via the GitHub API
  • Sets initial deployment status to in_progress
  • Derives environment name from mops file path (kubernetes/namespaces/<svc>/<env>/<cluster>/...<env>-<cluster>)
  • Writes three annotations on each Application CR:
    • deploy.staffbase.com/repo — source repository
    • deploy.staffbase.com/sha — full commit SHA
    • deploy.staffbase.com/deployment-id — GitHub Deployment ID
  • Soft-fails on API errors (warning emitted, image update proceeds)

Also updates README examples to use actions/checkout@v6, ubuntu-24.04, and [email protected].

Closes CI-1201

Checklist

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Review the Contributing Guideline and sign CLA
  • Reference relevant issue(s) and close them after merging

The changes and the PR were generated by Claude.

Add opt-in `create-deployment` boolean input that creates GitHub
Deployments on the source repository and writes tracking annotations
to the Application CR in the mops overlay. This enables the
flux-deployment-reporter to identify and update deployment status
without image-to-repo mapping or tag parsing.

New inputs: `create-deployment`, `github-token`
New output: `deployment-id` (JSON map of environment to deployment ID)

Closes CI-1201

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant