mcpField
D
devops

devops

github.com/htlin222Cloud & DevOps7842 installsUpdated 3w ago
Repository

About devops

A DevOps skill for setting up CI/CD, containerizing applications, configuring deployments, and automating infrastructure. It includes guidance and examples for Docker, GitHub Actions, and Kubernetes.

Key features

  1. 01CI/CD pipeline setup
  2. 02Dockerfile and Compose guidance
  3. 03GitHub Actions workflows
  4. 04Kubernetes deployment basics
  5. 05Build troubleshooting
  6. 06Infrastructure automation

Use cases

  1. 01Create a CI/CD workflow with tests and deployment steps
  2. 02Dockerize an application for local development
  3. 03Configure a Kubernetes deployment
  4. 04Investigate build failures

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/htlin222/dotfiles --skill devops

After installing, type/devopsin Claude Code to confirm it loaded.

Details

From the project README

DevOps

CI/CD pipelines, containerization, and deployment automation.

When to Use

  • Setting up CI/CD pipelines
  • Creating Dockerfiles
  • Configuring deployments
  • Troubleshooting builds
  • Infrastructure automation

Docker

Dockerfile Best Practices
# Multi-stage build
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
USER node
EXPOSE 3000
CMD ["node", "dist/index.js"]
Docker Compose
version: "3.8"
services:
  app:
    build: .
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgres://db:5432/app
    depends_on:
      - db
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3

  db:
    image: postgres:15-alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=app
      - POSTGRES_PASSWORD_FILE=/run/secrets/db_password
    secrets:
      - db_password

volumes:
  postgres_data:

secrets:
  db_password:
    file: ./secrets/db_password.txt

GitHub Actions

name: CI/CD

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: "npm"
      - run: npm ci
      - run: npm test
      - run: npm run lint

  deploy:
    needs: test
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Deploy
        run: |
          echo "Deploying to production"

Kubernetes Basics

apiVersion: apps/v1
kind: Deployment
metadata:
  name: app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
        - name: app
          image: myapp:latest
          ports:
            - containerPort: 3000
          resources:
            requests:
              memory: "128Mi"
              cpu: "100m"
            limits:
              memory: "256Mi"
              cpu: "200m"
          livenessProbe:
            httpGet:
              path: /health
              port: 3000
            initialDelaySeconds: 10
            periodSeconds: 30

Examples

Input: "Set up CI/CD for this project" Action: Detect framework, create GitHub Actions workflow, add tests and deploy steps

Input: "Dockerize this app" Action: Create optimized Dockerfile, docker-compose for local dev, document usage

Comments

Markdown supported