Skill站外收录 @skilllib/skill-2014279417629978626
gamma-deploy-integration
支持将 Gamma 集成应用一键部署至 Vercel、AWS、GCP 等主流云平台,自动完成密钥安全存储、环境变量配置及生产级发布流程,适配不同云服务的部署规范与权限体系。
开发运维 AI 技能
Skills.MD
# Gamma Deploy Integration
## Overview
Deploy Gamma-integrated applications to various cloud platforms with proper configuration and secret management.
## Prerequisites
- Completed CI integration
- Cloud platform account (Vercel, AWS, or GCP)
- Production Gamma API key
## Instructions
### Vercel Deployment
#### Step 1: Configure Vercel Project
```bash
# Install Vercel CLI
npm i -g vercel
# Link project
vercel link
# Set environment variable
vercel env add GAMMA_API_KEY production
```
#### Step 2: Create vercel.json
```json
{
"framework": "nextjs",
"buildCommand": "npm run build",
"env": {
"GAMMA_API_KEY": "@gamma_api_key"
},
"functions": {
"api/**/*.ts": {
"maxDuration": 30
}
}
}
```
#### Step 3: Deploy
```bash
# Preview deployment
vercel
# Production deployment
vercel --prod
```
### AWS Lambda Deployment
#### Step 1: Store Secret in AWS Secrets Manager
```bash
aws secretsmanager create-secret \
--name gamma/api-key \
--secret-string '{"apiKey":"your-gamma-api-key"}'
```
#### Step 2: Lambda Configuration
```typescript
// lambda/gamma-handler.ts
import { SecretsManager } from '@aws-sdk/client-secrets-manager';
import { GammaClient } from '@gamma/sdk';
const secretsManager = new SecretsManager({ region: 'us-east-1' });
let gamma: GammaClient;
async function getGammaClient() {
if (!gamma) {
const secret = await secretsManager.getSecretValue({
SecretId: 'gamma/api-key',
});
const { apiKey } = JSON.parse(secret.SecretString!);
gamma = new GammaClient({ apiKey });
}
return gamma;
}
export async function handler(event: any) {
const client = await getGammaClient();
const result = await client.presentations.create({
title: event.title,
prompt: event.prompt,
});
return { statusCode: 200, body: JSON.stringify(result) };
}
```
#### Step 3: SAM Template
```yaml
# template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
GammaFunction:
Type: AWS::Serverless::Function
Properties:
Handler: dist/gamma-handler.handler
Runtime: nodejs20.x
Timeout: 30
MemorySize: 256
Policies:
- SecretsManagerReadWrite
Environment:
Variables:
NODE_ENV: production
```
### Google Cloud Run Deployment
#### Step 1: Store Secret
```bash
echo -n "your-gamma-api-key" | \
gcloud secrets create gamma-api-key --data-file=-
```
#### Step 2: Dockerfile
```dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist ./dist
CMD ["node", "dist/server.js"]
```
#### Step 3: Deploy
```bash
gcloud run deploy gamma-service \
--image gcr.io/$PROJECT_ID/gamma-service \
--platform managed \
--region us-central1 \
--set-secrets GAMMA_API_KEY=gamma-api-key:latest \
--allow-unauthenticated
```
### GitHub Actions Deployment
```yaml
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: npm ci && npm run build
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
```
## Output
- Production deployment on chosen platform
- Secrets securely stored
- Environment variables configured
- Automated deployment pipeline
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Secret not found | Missing secret | Create secret in platform |
| Timeout | Function too slow | Increase timeout limit |
| Cold start | Lambda initialization | Use provisioned concurrency |
| Permission denied | IAM misconfigured | Update IAM policies |
## Resources
- [Vercel Documentation](https://vercel.com/docs)
- [AWS Lambda Documentation](https://docs.aws.amazon.com/lambda/)
- [Google Cloud Run](https://cloud.google.com/run/docs)
## Next Steps
Proceed to `gamma-webhooks-events` for event handling.
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「gamma-deploy-integration」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次