Deployment in Edgit is just metadata. When you “deploy,” you’re creating a Git tag that points to a version:
# Create version tagedgit tag create prompts/extraction v1.0.0edgit push --tags# Deploy to production (set environment slot)edgit tag set prompts/extraction production v1.0.0edgit push --tags --force
Tags use the 4-level format: {prefix}/{type}/{name}/{slot} where slots are environments like staging, production, or canary.Edgit’s job ends at git push. Your CI/CD (GitHub Actions) reads these tags, syncs to Cloudflare KV, and triggers rebuilds.This means:
Deployments are instant (just Git tags)
Rollbacks are instant (update the tag)
You can deploy different versions to different environments simultaneously
# 1. Create versionedgit tag create prompts/extraction v1.1.0edgit push --tags# 2. Deploy to stagingedgit tag set prompts/extraction staging v1.1.0edgit push --tags --force# 3. Test in stagingcurl https://staging.example.com/test# 4. Promote to productionedgit tag set prompts/extraction production v1.1.0edgit push --tags --force
Note: Version tags (v1.1.0) don’t need --force. Environment tags (staging, production) need --force because they move between versions.When to use: Most production systems, especially when starting outPros:
Simple to understand
Clear separation of environments
Easy to test before production
Cons:
Slower (requires testing in each environment)
Staging might not catch all issues (different data, traffic patterns)
# Create versionedgit tag create prompts/extraction v1.1.0edgit push --tags# Deploy to production and canaryedgit tag set prompts/extraction production v1.0.0edgit tag set prompts/extraction canary v1.1.0edgit push --tags --force
# 1. Deploy new version to canary (10% traffic)edgit tag set prompts/extraction canary v1.1.0edgit push --tags --force# 2. Monitor canary# Watch error rates, latency, user feedback# 3. If good, promote to productionedgit tag set prompts/extraction production v1.1.0edgit push --tags --force
# Create versionedgit tag create prompts/extraction v1.1.0edgit push --tags# Blue environment (current production)edgit tag set prompts/extraction blue v1.0.0edgit push --tags --force# Green environment (new version)edgit tag set prompts/extraction green v1.1.0edgit push --tags --force
# 1. Test green thoroughlycurl https://green.example.com/test# 2. Switch production traffic to green# Update load balancer / DNS to point to green# 3. Keep blue running for quick rollback# 4. After confirming green is stable, update blueedgit tag set prompts/extraction blue v1.1.0edgit push --tags --force
When to use: When you need instant rollback without affecting usersPros:
# 1. Deploy both versions as environment slotsedgit tag set prompts/extraction control v1.0.0edgit tag set prompts/extraction treatment v1.1.0edgit push --tags --force# 2. Collect metrics from both# Track success rates, user satisfaction, performance# 3. Pick winneredgit tag set prompts/extraction production v1.1.0edgit push --tags --force
When to use: When you want to measure impact objectivelyPros:
# Day 1: Deploy to 1%edgit tag create prompts/extraction v1.1.0edgit push --tagsedgit tag set prompts/extraction rollout-1pct v1.1.0edgit push --tags --force# Day 2: Increase to 10%edgit tag set prompts/extraction rollout-10pct v1.1.0edgit push --tags --force# Day 3: Increase to 50%edgit tag set prompts/extraction rollout-50pct v1.1.0edgit push --tags --force# Day 4: Full rolloutedgit tag set prompts/extraction production v1.1.0edgit push --tags --force
ensemble: progressive-rolloutagents: # Use new version based on percentage - name: analyzer operation: think component: > ${Math.random() * 100 < env.ROLLOUT_PERCENTAGE ? 'prompts/extraction@v1.1.0' : 'prompts/extraction@v1.0.0'}
When to use: When you want fine-grained control over rollout speedPros:
# Ring 0: Internal teamedgit tag set prompts/extraction ring-0 v1.1.0edgit push --tags --force# Ring 1: Beta usersedgit tag set prompts/extraction ring-1 v1.1.0edgit push --tags --force# Ring 2: Early adopters (10%)edgit tag set prompts/extraction ring-2 v1.1.0edgit push --tags --force# Ring 3: General users (remaining 90%)edgit tag set prompts/extraction ring-3 v1.0.0edgit push --tags --force
When to use: Large user bases with different risk tolerancesPros:
# Stage 1: Dev testingedgit tag set prompts/extraction dev v1.1.0edgit push --tags --force# Stage 2: Staging with production dataedgit tag set prompts/extraction staging v1.1.0edgit push --tags --force# Stage 3: Production canary (5%)edgit tag set prompts/extraction canary-5 v1.1.0edgit push --tags --force# Stage 4: Increase canary (25%)edgit tag set prompts/extraction canary-25 v1.1.0edgit push --tags --force# Stage 5: Full rolloutedgit tag set prompts/extraction production v1.1.0edgit push --tags --force
# Something's wrong! Roll back to previous versionedgit tag set prompts/extraction production v1.0.0edgit push --tags --force# Under 50ms later (if using Cloudflare KV), you're back
Remember:--force is required for environment tags because you’re moving the tag to point to a different version.
# Do: Start with smallest possible audienceedgit tag set prompts/extraction canary-1 v1.1.0edgit push --tags --force# Don't: YOLO full productionedgit tag set prompts/extraction production v1.1.0edgit push --tags --force
# Version tags: No --force needededgit tag create prompts/extraction v1.1.0edgit push --tags# Environment tags: Require --forceedgit tag set prompts/extraction production v1.1.0edgit push --tags --force