- Integrated all production features into main application flow - Added metrics, tracing, caching, and health checks to API server - Enhanced trade execution with circuit breakers and retry policies - Integrated database persistence for trades and metrics - Added structured logging and observability - Enhanced middleware with missing validators and rate limiters - Added comprehensive error handling and resilience patterns
77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
name: CD Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
deploy-staging:
|
|
name: Deploy to Staging
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/main'
|
|
environment:
|
|
name: staging
|
|
url: https://staging-api.immortal-bot.com
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Run tests
|
|
run: bun test
|
|
env:
|
|
NODE_ENV: test
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t immortal-bot-staging:${{ github.sha }} -f Dockerfile.backend .
|
|
|
|
- name: Deploy to staging
|
|
run: |
|
|
echo "Deploy to staging server"
|
|
# Add actual deployment commands here
|
|
# e.g., docker push, kubectl apply, etc.
|
|
|
|
deploy-production:
|
|
name: Deploy to Production
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
environment:
|
|
name: production
|
|
url: https://api.immortal-bot.com
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Run full test suite
|
|
run: bun test --coverage
|
|
env:
|
|
NODE_ENV: test
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t immortal-bot:${{ github.ref_name }} -f Dockerfile.backend .
|
|
docker tag immortal-bot:${{ github.ref_name }} immortal-bot:latest
|
|
|
|
- name: Deploy to production
|
|
run: |
|
|
echo "Deploy to production server"
|
|
# Add actual deployment commands here
|
|
# Include health checks and rollback procedures
|
|
|