Skip to content

CI: Add apply build script #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

robertjdominguez
Copy link
Collaborator

Description

Automated deployment workflow that takes PromptQL builds from staging to production when PRs merge.

  • Triggers only on merged PRs that touched demo directories
  • Parses build versions from PR comments left by the create-build workflow
  • Applies each build to its respective production environment using demo-specific credentials

Previously, builds lived in limbo after PR approval - someone had to manually run ddn supergraph build apply for each demo. Not exactly the kind of toil that sparks joy.

# Before: Manual deployment dance
cd demos/healthcare
ddn auth login --pat $HEALTHCARE_PAT
ddn supergraph build apply abc123
cd ../telco
ddn auth login --pat $TELCO_PAT
ddn supergraph build apply def456
# ... repeat for each demo

Now the workflow handles the entire deployment pipeline automatically. The build detection logic searches merged PRs for comments containing 🚀 PromptQL Builds Complete, then uses regex pattern matching to extract build versions:

// Finds comments like:
// ### AML Demo
// **Build Version:** `abc123`
// ### TELCO Demo  
// **Build Version:** `def456`

const buildMatches = [...buildComment.body.matchAll(
  /### ([A-Z]+) Demo[\s\S]*?\*\*Build Version:\*\* `([^`]+)`/g
)];

const builds = buildMatches.map(match => ({
  demo: match[1].toLowerCase(),  // "aml", "telco"
  version: match[2]              // "abc123"
}));

Each extracted build gets applied to its corresponding demo environment using the appropriate service account credentials. The workflow switches authentication contexts per demo and applies builds with proper error handling - failed deployments don't block other demos from going live.

Comments back to the merged PR with deployment status and threads Slack notifications with the original build announcements, maintaining conversation context across the entire build-to-deploy lifecycle.

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