Build & Deploy
This skill should be used when the user asks to "build the project", "run the build", "deploy to production", "validate build", "CI/CD pipeline", "deployment configuration", "pre-flight checks", "release process", or mentions build and deployment operations.
What this skill does
# Build & Deploy
Comprehensive build and deployment skill for validation, CI/CD patterns, and deployment strategies.
## Core Capabilities
### Build Validation
Validate builds before deployment:
**Pre-build checks:**
- Dependencies installed correctly
- Environment variables set
- Required services available
- Configuration files valid
**Build process:**
```bash
# Python project
pip install -r requirements.txt
python -m pytest
python -m mypy src/
python -m build
# Node.js project
npm ci
npm run lint
npm run test
npm run build
```
**Post-build validation:**
- Build artifacts exist
- Artifact sizes reasonable
- Version numbers correct
- No development dependencies in production
### CI/CD Patterns
Common continuous integration/deployment patterns:
**GitHub Actions:**
```yaml
name: CI/CD Pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install -r requirements.txt
- run: pytest --cov=src
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker build -t app:${{ github.sha }} .
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- run: echo "Deploy to production"
```
**Pipeline stages:**
1. **Lint**: Code style and quality
2. **Test**: Unit and integration tests
3. **Build**: Create artifacts
4. **Security**: Scan for vulnerabilities
5. **Deploy**: Push to environment
### Deployment Strategies
Choose appropriate deployment approach:
**Rolling Deployment:**
- Gradual replacement of instances
- Zero downtime
- Easy rollback
- Best for: Stateless services
**Blue-Green Deployment:**
- Two identical environments
- Instant switch between versions
- Simple rollback
- Best for: Critical services
**Canary Deployment:**
- Small percentage gets new version
- Gradual traffic increase
- Risk mitigation
- Best for: High-traffic services
**Feature Flags:**
- Deploy code, enable separately
- Gradual rollout to users
- Quick disable if issues
- Best for: New features
### Pre-flight Checks
Validation before deployment:
**Checklist:**
```
[ ] All tests pass
[ ] Security scan clean
[ ] Build artifacts valid
[ ] Configuration correct
[ ] Database migrations ready
[ ] Dependencies compatible
[ ] Rollback plan documented
[ ] Monitoring configured
[ ] Team notified
```
**Automated checks:**
```bash
# Environment validation
./scripts/check-env.sh
# Database connectivity
./scripts/check-db.sh
# External service health
./scripts/check-services.sh
# Configuration validation
./scripts/validate-config.sh
```
## Build Workflows
### Local Build
For development and testing:
```bash
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements-dev.txt
# Run tests
pytest
# Build package
python -m build
```
### Production Build
For deployment:
```bash
# Install production dependencies only
pip install -r requirements.txt
# Run production build
python -m build --wheel
# Verify artifact
ls dist/
```
### Container Build
For containerized deployments:
```dockerfile
# Multi-stage Dockerfile
FROM python:3.11-slim as builder
WORKDIR /app
COPY requirements.txt .
RUN pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt
FROM python:3.11-slim
WORKDIR /app
COPY --from=builder /wheels /wheels
RUN pip install --no-cache /wheels/*
COPY src/ ./src/
CMD ["python", "-m", "src.main"]
```
## Deployment Workflows
### GCP Cloud Run
```bash
# Build and push image
gcloud builds submit --tag gcr.io/PROJECT/APP
# Deploy to Cloud Run
gcloud run deploy APP \
--image gcr.io/PROJECT/APP \
--platform managed \
--region us-central1 \
--allow-unauthenticated
```
### GCP Compute Engine
```bash
# Create instance template
gcloud compute instance-templates create APP-template \
--machine-type=e2-medium \
--image-family=debian-11 \
--metadata-from-file=startup-script=startup.sh
# Update managed instance group
gcloud compute instance-groups managed rolling-action start-update APP-group \
--version=template=APP-template
```
### GCP Cloud Functions
```bash
# Deploy function
gcloud functions deploy FUNCTION_NAME \
--runtime python311 \
--trigger-http \
--entry-point main \
--source ./src
```
## Environment Management
### Environment Variables
**Required variables:**
```bash
# Application
APP_ENV=production
APP_DEBUG=false
APP_SECRET_KEY=<secret>
# Database
DATABASE_URL=postgresql://...
REDIS_URL=redis://...
# External Services
API_KEY=<key>
```
**Validation:**
```python
required_vars = [
'DATABASE_URL',
'APP_SECRET_KEY',
'API_KEY',
]
missing = [v for v in required_vars if not os.getenv(v)]
if missing:
raise ValueError(f"Missing env vars: {missing}")
```
### Configuration Management
**Environment-specific configs:**
```
config/
├── base.py # Shared settings
├── development.py
├── staging.py
└── production.py
```
**Loading pattern:**
```python
import os
env = os.getenv('APP_ENV', 'development')
config = importlib.import_module(f'config.{env}')
```
## Rollback Procedures
### Quick Rollback
```bash
# GCP Cloud Run
gcloud run services update-traffic APP \
--to-revisions=PREVIOUS_REVISION=100
# Docker/Kubernetes
kubectl rollout undo deployment/APP
# Database (if migration failed)
python manage.py migrate APP PREVIOUS_MIGRATION
```
### Rollback Checklist
```
[ ] Identify the issue
[ ] Notify stakeholders
[ ] Execute rollback command
[ ] Verify service health
[ ] Investigate root cause
[ ] Document incident
```
## Monitoring Integration
### Health Checks
```python
@app.get("/health")
def health_check():
return {
"status": "healthy",
"version": APP_VERSION,
"timestamp": datetime.utcnow().isoformat()
}
@app.get("/ready")
def readiness_check():
# Check dependencies
db_ok = check_database()
cache_ok = check_redis()
return {
"ready": db_ok and cache_ok,
"checks": {
"database": db_ok,
"cache": cache_ok
}
}
```
### Deployment Metrics
Track after deployment:
- Response times
- Error rates
- Resource utilization
- Business metrics
## Integration
Coordinate with other skills:
- **security-scanning skill**: Pre-deploy security checks
- **test-coverage skill**: Ensure adequate coverage
- **git-workflows skill**: Tag releases, update changelog
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.