CI/CD 파이프라인 구성, GitHub Actions, 배포 전략에 대한 패턴 가이드입니다.
CI/CD 파이프라인과 GitHub Actions 워크플로우를 작성할 때 최신 문법과 패턴을 제공합니다. CI/CD, GitHub Actions, 배포 전략 키워드가 감지되면 Context7 MCP를 통해 최신 문서를 조회합니다.
/plugin marketplace add m16khb/claude-integration/plugin install full-stack-orchestration@claude-integrationThis skill inherits all available tools. When active, it can use any tool Claude has access to.
CI/CD 파이프라인 구성, GitHub Actions, 배포 전략에 대한 패턴 가이드입니다.
SKILL ACTIVATION:
├─ Context7 MCP 호출 (최신 문서 조회)
│ ├─ resolve-library-id("github-actions")
│ ├─ get-library-docs(topic="workflow jobs matrix")
│ └─ 최신 GitHub Actions 문법 확인
│
└─ 적용 시점:
├─ CI/CD 파이프라인 설계 시
├─ GitHub Actions 워크플로우 작성 시
└─ 배포 전략 구성 시
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env: { POSTGRES_USER: test, POSTGRES_PASSWORD: test, POSTGRES_DB: test }
ports: ['5432:5432']
options: --health-cmd pg_isready
redis:
image: redis:7
ports: ['6379:6379']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20', cache: 'npm' }
- run: npm ci
- run: npm run lint
- run: npm run test:cov
env:
DATABASE_URL: postgres://test:test@localhost:5432/test
REDIS_URL: redis://localhost:6379
- uses: codecov/codecov-action@v4
name: Build Docker
on:
push:
tags: ['v*']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
RUN addgroup -g 1001 -S nodejs && adduser -S nestjs -u 1001
COPY --from=builder --chown=nestjs:nodejs /app/dist ./dist
COPY --from=builder --chown=nestjs:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=nestjs:nodejs /app/package.json ./
USER nestjs
EXPOSE 3000
CMD ["node", "dist/main.js"]
| 전략 | 설명 | 장점 | 단점 |
|---|---|---|---|
| Blue-Green | 두 환경 전환 | 빠른 롤백 | 리소스 2배 |
| Canary | 트래픽 점진 증가 | 안전한 배포 | 복잡한 구성 |
| Rolling Update | 순차적 업데이트 | 다운타임 없음 | 느린 롤백 |
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1 # 최대 1개 추가 Pod
maxUnavailable: 0 # 항상 최소 replicas 유지
template:
spec:
containers:
- name: api
image: ghcr.io/org/api:latest
readinessProbe:
httpGet: { path: /health, port: 3000 }
initialDelaySeconds: 5
livenessProbe:
httpGet: { path: /health, port: 3000 }
initialDelaySeconds: 15
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: api-production
spec:
project: default
source:
repoURL: https://github.com/org/k8s-manifests
targetRevision: main
path: production/api
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
# GitHub Actions Secrets
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
# Kubernetes Secrets
kubectl create secret generic api-secrets \
--from-literal=DATABASE_URL='postgres://...' \
--from-literal=JWT_SECRET='...'
@Controller('health')
export class HealthController {
@Get()
@HealthCheck()
check() {
return this.health.check([
() => this.db.pingCheck('database'),
() => this.redis.pingCheck('redis'),
]);
}
@Get('liveness')
liveness() { return { status: 'ok' }; }
@Get('readiness')
@HealthCheck()
readiness() {
return this.health.check([() => this.db.pingCheck('database')]);
}
}
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.