internal-comms
Write internal communications following company formats, including status reports, leadership updates, and newsletters.
ANanthropics/skills203k3,333 new stars in the last 7 days
Render 部署方法论,使用 render.yaml 蓝图和 Render CLI 部署全栈应用(Web 服务、Worker、静态站点、数据库)
Render 支持两种部署方式:
render.yaml 放在项目根目录,定义所有基础设施。
services:
# 前端静态站点
- type: web
name: my-frontend
env: static
buildCommand: npm ci && npm run build
staticPublishPath: dist
routes:
- type: rewrite
source: /*
destination: /index.html
# 后端 API 服务
- type: web
name: my-api
env: node
buildCommand: npm ci && npm run build
startCommand: npm start
healthCheckPath: /health
envVars:
- key: NODE_ENV
value: production
- key: DATABASE_URL
fromDatabase:
name: my-db
property: connectionString
- key: API_KEY
sync: false # 需要在 Dashboard 手动设置
# 后台 Worker
- type: worker
name: my-worker
env: node
buildCommand: npm ci
startCommand: npm run worker
envVars:
- key: DATABASE_URL
fromDatabase:
name: my-db
property: connectionString
databases:
- name: my-db
databaseName: myapp
user: myapp
plan: free # free | starter | standard | pro
ipAllowList:
- source: 0.0.0.0/0
description: allow all (仅开发环境)
services:
- type: web
name: my-site
env: static
buildCommand: npm run build
staticPublishPath: dist
headers:
- path: /*
name: X-Frame-Options
value: DENY
services:
- type: web
name: my-api
env: node
plan: standard
buildCommand: npm ci && npm run build
startCommand: node dist/server.js
healthCheckPath: /health
autoDeploy: true
branch: main
numInstances: 1
services:
- type: web
name: my-app
env: docker
dockerfilePath: ./Dockerfile
dockerContext: .
dockerCommand: ./start.sh
healthCheckPath: /health
services:
- type: web
name: my-api
env: python
buildCommand: pip install -r requirements.txt
startCommand: gunicorn app:app
healthCheckPath: /health
services:
- type: web
name: my-api
env: go
buildCommand: go build -o server
startCommand: ./server
healthCheckPath: /health
services:
- type: worker
name: my-worker
env: node
buildCommand: npm ci
startCommand: npm run worker
services:
- type: cron
name: my-cron
env: node
schedule: "0 2 * * *" # 每天凌晨 2 点
buildCommand: npm ci
startCommand: npm run cron
databases:
- name: my-postgres
databaseName: myapp
user: myapp
plan: starter
version: "16"
ipAllowList:
- source: 10.0.0.0/8
description: internal
- name: my-redis
type: redis
plan: starter
maxmemoryPolicy: allkeys-lru
envVars:
# 静态值
- key: NODE_ENV
value: production
# 从服务组同步(所有服务共享)
- key: SHARED_KEY
sync: true
value: some-value
# 从另一个服务获取
- key: API_URL
fromService:
type: web
name: my-api
property: host
# 从数据库获取连接串
- key: DATABASE_URL
fromDatabase:
name: my-db
property: connectionString
# 需要手动设置的密钥
- key: STRIPE_SECRET_KEY
sync: false
render.yaml 并创建服务# 安装 Render CLI
npm install -g render-cli
# 或 brew install render
# 登录(需要用户交互)
render login
# 触发部署
render services deploy <service-id-or-name>
# 查看部署状态
render services list-deploys <service-id-or-name>
如需直接调用 Render REST API,请在受信任的 CI 环境中使用官方 GitHub Action,详见下方 CI/CD 集成。
使用 Render 官方 GitHub Action 触发部署:
name: Deploy to Render
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test
- name: Trigger Render Deploy
uses: renderinc/deploy-render-action@v1
with:
serviceId: ${{ secrets.RENDER_SERVICE_ID }}
apiKey: ${{ secrets.RENDER_API_KEY }}
需要的 Secrets:
RENDER_API_KEY:Render API Key(Account Settings → API Keys)RENDER_SERVICE_ID:服务 ID(Dashboard 服务页面 URL 中 srv-xxx)| 项目类型 | env 类型 | buildCommand | startCommand |
|---|---|---|---|
| Next.js (Node) | node | npm ci && npm run build | npm start |
| Vite 静态站点 | static | npm ci && npm run build | - |
| Express API | node | npm ci | npm start |
| Django | python | pip install -r requirements.txt | gunicorn app:app |
| FastAPI | python | pip install -r requirements.txt | uvicorn main:app |
| Gin (Go) | go | go build -o server | ./server |
| Docker 应用 | docker | (Dockerfile) | (Dockerfile CMD) |
render.yaml 放在项目根目录databases 中定义sync: false)Write internal communications following company formats, including status reports, leadership updates, and newsletters.
ANanthropics/skills203k3,333 new stars in the last 7 days
GAgarrytan/gstack143k636 new stars in the last 7 days
ADaddyosmani/agent-skills122k1,627 new stars in the last 7 days
A pre-launch checklist covering monitoring, staged rollouts and rollback plans.
ADaddyosmani/agent-skills122k1,627 new stars in the last 7 days
PApaperclipai/paperclip119k2,120 new stars in the last 7 days
RUruvnet/RuView106k693 new stars in the last 7 days