| name | openevidence-deploy-integration |
| description | Deploy OpenEvidence integrations to healthcare production environments.
Use when deploying to production, setting up staging environments,
or configuring cloud deployments for clinical AI applications.
Trigger with phrases like "deploy openevidence", "openevidence staging",
"openevidence production deploy", "release openevidence".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
OpenEvidence Deploy Integration
Overview
Deploy OpenEvidence clinical AI integrations to production healthcare environments with proper security, compliance, and rollback capabilities.
Prerequisites
- CI pipeline configured (see
openevidence-ci-integration)
- Production credentials from OpenEvidence
- Cloud platform configured (GCP, AWS, Azure)
- Signed BAA for production environment
Instructions
Step 1: Multi-Environment Configuration
interface OpenEvidenceEnvConfig {
baseUrl: string;
timeout: number;
retries: number;
secretPath: string;
features: {
deepConsult: boolean;
webhooks: boolean;
caching: boolean;
};
}
export const environments: Record<string, OpenEvidenceEnvConfig> = {
development: {
baseUrl: 'https://api.sandbox.openevidence.com',
timeout: 60000,
retries: 1,
secretPath: 'local',
features: {
deepConsult: true,
webhooks: false,
caching: false,
},
},
staging: {
baseUrl: 'https://api.sandbox.openevidence.com',
timeout: 45000,
retries: 2,
secretPath: 'projects/staging/secrets/openevidence',
features: {
deepConsult: ,
: ,
: ,
},
},
: {
: ,
: ,
: ,
: ,
: {
: ,
: ,
: ,
},
},
};
(): {
env = process.. || ;
environments[env] || environments.;
}
Step 2: GitHub Actions Deployment Workflow
name: Deploy OpenEvidence Integration
on:
push:
branches: [main]
tags: ['v*']
workflow_dispatch:
inputs:
environment:
description: 'Deployment environment'
required: true
default: 'staging'
type: choice
options:
- staging
- production
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
SERVICE_NAME: clinical-evidence-api
REGION: us-central1
jobs:
test:
uses: ./.github/workflows/openevidence-ci.yml
secrets: inherit
build:
needs: test
runs-on: ubuntu-latest
outputs:
image: ${{ steps.build.outputs.image }}
steps:
-
[, ]
[ ]
Step 3: Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: clinical-evidence-api
labels:
app: clinical-evidence-api
spec:
replicas: 3
selector:
matchLabels:
app: clinical-evidence-api
template:
metadata:
labels:
app: clinical-evidence-api
spec:
serviceAccountName: clinical-evidence-api
containers:
- name: api
image: gcr.io/PROJECT_ID/clinical-evidence-api:VERSION
ports:
- containerPort: 8080
env:
- name: NODE_ENV
value: production
- name: OPENEVIDENCE_API_KEY
valueFrom:
secretKeyRef:
name: openevidence-secrets
key: api-key
-
Step 4: Health Check Endpoint
import { Router } from 'express';
import { OpenEvidenceClient } from '@openevidence/sdk';
import { getConfig } from '../config/environments';
const router = Router();
router.get('/health', (req, res) => {
res.json({
status: 'healthy',
timestamp: new Date().toISOString(),
version: process.env.npm_package_version,
});
});
router.get('/health/openevidence', async (req, res) => {
const startTime = Date.now();
try {
const client = new OpenEvidenceClient({
apiKey: process.env.OPENEVIDENCE_API_KEY!,
orgId: process.env.OPENEVIDENCE_ORG_ID!,
baseUrl: getConfig().baseUrl,
});
await client.health.check();
res.({
: ,
: .() - startTime,
: process..,
: ().,
});
} (: ) {
res.().({
: ,
: .() - startTime,
: error.,
});
}
});
router;
Step 5: Rollback Procedure
#!/bin/bash
set -e
SERVICE_NAME="clinical-evidence-api"
REGION="us-central1"
echo "=== OpenEvidence Integration Rollback ==="
echo "Recent revisions:"
gcloud run revisions list --service $SERVICE_NAME --region $REGION --limit 5
CURRENT=$(gcloud run services describe $SERVICE_NAME --region $REGION \
--format 'value(status.traffic[0].revisionName)')
PREVIOUS=$(gcloud run revisions list --service $SERVICE_NAME --region $REGION \
--format 'value(metadata.name)' --limit 2 | tail -1)
echo "Current: $CURRENT"
echo "Rolling back to: $PREVIOUS"
read -p "Proceed with rollback? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
gcloud run services update-traffic $SERVICE_NAME \
--region $REGION \
--to-revisions $PREVIOUS=100
echo "Rollback complete. Monitoring..."
sleep 30
gcloud run services describe $SERVICE_NAME --region $REGION \
--format 'value(status.url)' | xargs -I {} curl -sf {}/health/openevidence
Output
- Multi-environment deployment configuration
- CI/CD pipeline with canary releases
- Kubernetes deployment manifests
- Health check endpoints
- Rollback procedures
Deployment Checklist
Error Handling
| Deployment Issue | Detection | Resolution |
|---|
| Health check fails | Readiness probe | Rollback to previous revision |
| High error rate | Monitoring alert | Rollback, investigate logs |
| Secret missing | Container fails to start | Check secret manager |
| Rate limit hit | 429 errors spike | Scale down, check quotas |
Resources
Next Steps
For webhook configuration, see openevidence-webhooks-events.