Configure OpenEvidence across development, staging, and production environments.
Use when setting up multiple environments, managing environment-specific configurations,
or implementing environment promotion strategies for clinical AI applications.
Trigger with phrases like "openevidence environments", "openevidence staging",
"openevidence dev setup", "multi-environment openevidence".
Configure OpenEvidence across development, staging, and production environments.
Use when setting up multiple environments, managing environment-specific configurations,
or implementing environment promotion strategies for clinical AI applications.
Trigger with phrases like "openevidence environments", "openevidence staging",
"openevidence dev setup", "multi-environment openevidence".
allowed-tools
Read, Write, Edit
version
1.0.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
OpenEvidence Multi-Environment Setup
Overview
Configure and manage OpenEvidence integrations across development, staging, and production environments with proper isolation and promotion strategies.
Prerequisites
OpenEvidence accounts for each environment
Separate API keys per environment
Infrastructure for each environment (cloud or on-premise)
# .github/workflows/promotion.ymlname:EnvironmentPromotionon:workflow_dispatch:inputs:source_env:description:'Source environment'required:truetype:choiceoptions:-stagingtarget_env:description:'Target environment'required:truetype:choiceoptions:-productionversion:description:'Version to promote (e.g., v1.2.3)'required:truejobs:validate:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v4-name:Validateversionexistsinsourcerun:|
# Check that the version exists and is deployed in source
SOURCE_VERSION=$(curl -sf "${{ secrets.STAGING_URL }}/health" | jq -r '.version')
if [ "$SOURCE_VERSION" != "${{ inputs.version }}" ]; then
echo "Version mismatch: staging has $SOURCE_VERSION, expected ${{ inputs.version }}"
exit 1
fi
-name:Validatestagingtestspassedrun:|
# Check that all tests passed for this version
gh run list --workflow=openevidence-ci.yml \
--branch=main --status=success \
--json conclusion,headBranch | jq -e '.[0]'
promote:needs:validateruns-on:ubuntu-latestenvironment:productionsteps:-uses:actions/checkout@v4with:ref:${{inputs.version}}-name:SetupCloudSDKuses:google-github-actions/setup-gcloud@v2with:project_id:${{secrets.PROD_PROJECT_ID}}-name:DeploytoProductionrun:|
gcloud run deploy clinical-evidence-api \
--image gcr.io/${{ secrets.STAGING_PROJECT_ID }}/clinical-evidence-api:${{ inputs.version }} \
--region us-central1 \
--set-env-vars NODE_ENV=production \
--no-traffic
-name:Runsmoketestsrun:|
REVISION=$(gcloud run revisions list --service clinical-evidence-api \
--region us-central1 --format 'value(metadata.name)' --limit 1)
# Test the new revision directly
./scripts/smoke-test.sh "$REVISION"
-name:Gradualtrafficshiftrun:|
# 10% -> 50% -> 100%
for percent in 10 50 100; do
gcloud run services update-traffic clinical-evidence-api \
--region us-central1 \
--to-latest=$percent
sleep 300 # Wait 5 minutes between shifts
done
-name:Createproductionreleaseuses:softprops/action-gh-release@v1with:tag_name:${{inputs.version}}-productionname:ProductionRelease${{inputs.version}}body:|
Promoted to production from staging.
Original version: ${{ inputs.version }}