Skip to content

Latest commit

 

History

History
111 lines (83 loc) · 3.99 KB

File metadata and controls

111 lines (83 loc) · 3.99 KB

TODO: GitOps Essential Events

This file tracks webhook events essential for GitOps deployment workflows.

Currently Implemented ✅

  • push - Push commits to a branch (triggers sync and reconciliation)
  • ping - Webhook configuration test

Essential for GitOps Deployment

Core GitOps Events

  • pull_request - PR workflow for preview environments

    • Used for: Creating preview/staging environments on PR open
    • Action: Deploy PR branch, run tests, create deployment preview
    • Key data: PR number, branch, base branch, action (opened/closed/merged)
  • create - Branch or tag created

    • Used for: Tracking new branches for environment provisioning
    • Action: Initialize environment for new branch if needed
    • Key data: ref, ref_type (branch/tag), repository
  • delete - Branch or tag deleted

    • Used for: Cleanup of environments when branches are deleted
    • Action: Tear down preview environments, cleanup resources
    • Key data: ref, ref_type (branch/tag), repository

Deployment Tracking Events

  • deployment - Deployment created

    • Used for: Tracking deployment requests
    • Action: Record deployment intent, prepare environment
    • Key data: deployment id, environment, ref, sha
  • deployment_status - Deployment status changed

    • Used for: Monitoring deployment progress (pending/success/failure)
    • Action: Update deployment status, notify on completion
    • Key data: deployment id, state, environment, target_url
  • release - Release published

    • Used for: Production deployments triggered by releases
    • Action: Deploy to production environment
    • Key data: tag_name, name, body, prerelease flag

CI/CD Integration Events

  • check_run - Check run activity

    • Used for: Waiting for CI checks before deployment
    • Action: Gate deployments on successful checks
    • Key data: status, conclusion, check suite, app
  • check_suite - Check suite activity

    • Used for: Overall CI/CD pipeline status
    • Action: Trigger deployments when all checks pass
    • Key data: status, conclusion, head_branch, head_sha
  • workflow_run - GitHub Actions workflow completed

    • Used for: Triggering deployments after build workflows
    • Action: Deploy artifacts after successful builds
    • Key data: conclusion, workflow name, head_branch, artifacts
  • status - Commit status updated

    • Used for: Legacy CI status tracking
    • Action: Gate deployments based on commit status
    • Key data: state, context, target_url, sha

Implementation Priority

  1. Phase 1 (Core): pull_request, create, delete - Environment lifecycle
  2. Phase 2 (Deployment): deployment, deployment_status, release - Deployment tracking
  3. Phase 3 (CI/CD): check_run, check_suite, workflow_run, status - CI integration

GitOps Use Cases

Use Case 1: Preview Environments

pull_request[opened] → Create preview env → Deploy PR branch
pull_request[synchronize] → Update preview env → Deploy latest commit
pull_request[closed] → Destroy preview env → Cleanup resources

Use Case 2: Branch-based Deployment

push[main] → Sync manifests → Deploy to staging
release[published] → Sync manifests → Deploy to production
delete[branch] → Cleanup → Remove environment

Use Case 3: CI-Gated Deployment

push[develop] → Wait for checks
check_suite[completed, success] → Deploy to dev environment
workflow_run[completed, build] → Deploy artifacts

Use Case 4: Deployment Status Tracking

deployment[created] → Start deployment
deployment_status[in_progress] → Update progress
deployment_status[success] → Mark complete
deployment_status[failure] → Rollback

Non-GitOps Events

All other webhook events (issues, comments, stars, security alerts, etc.) are tracked in EVENTS.md but are not essential for GitOps deployment workflows.

Resources