0 Interaction
0 Views
Views
0 Likes
BONUS
DevOps & Cloud CI/CD
CI/CD Pipelines GitHub Actions Jenkins Bonus Module 3

CI/CD for Auto Deployments – From Code Commit to Production

Learn to automate the entire deployment lifecycle for your AI workflows. Build pipelines that test, build, and deploy your containerized automations (from Docker & K8s bonuses) with every code change.

CI/CD basics
Auto deployments
Testing gates
Builds on all bonuses

🔗 Knowledge graph – CI/CD automates the path to production

Docker Bonus

Containerized apps ready for deployment

K8s Bonus

Target platform for deployments

Day 1-21

Your automation code needs CI/CD

Day 20

Optimization includes deployment speed

Day 21-22

Portfolio & career – CI/CD skills add $20k+ to salary

Shared link: The Docker bonus taught you to package automations. The K8s bonus taught you to run them at scale. CI/CD is the glue that automatically builds, tests, and deploys new versions when you push code – completing the DevOps trinity .

🔄 What is CI/CD? Continuous Integration & Continuous Delivery

📌 Automating the path from commit to production

Continuous Integration (CI): Automatically build and test every code change. Developers merge code frequently, and CI catches integration issues early [citation:7].

Continuous Delivery (CD): Automatically deploy tested code to environments (staging, production) [citation:6]. Combined with CI, you get a fully automated pipeline.

Analogy: Think of CI/CD as an automated factory assembly line. You put raw materials (code) in at one end. The line automatically checks quality (tests), assembles (builds), packages (containerizes), and ships (deploys) to customers – all without human intervention .

Code Commit

Developer pushes to GitHub/GitLab

CI: Test

Automated unit + integration tests

CI: Build

Create Docker image (Bonus 1)

CD: Deploy

Push to K8s (Bonus 2)

Verify

Smoke tests, monitoring

Notify

Slack/Discord alerts

⚙️ Choosing Your CI/CD Tool

GitHub Actions

Best for: GitHub users, simple to complex pipelines

Pros: Native GitHub integration, free for public repos, huge marketplace [citation:1]

Cons: Limited to GitHub (mostly)

Use case: Perfect for your Day 21 portfolio code hosted on GitHub

Jenkins

Best for: Enterprise, complex custom pipelines

Pros: Most flexible, huge plugin ecosystem, self-hosted [citation:4]

Cons: Requires maintenance, steeper learning curve

Use case: When you need full control over infrastructure

GitLab CI

Best for: GitLab users, all-in-one DevOps

Pros: Integrated with GitLab, great Kubernetes support

Cons: Self-hosted runners require setup

CircleCI

Best for: Fast, container-native pipelines

Pros: Excellent Docker support, fast [citation:9]

🐳 CI/CD + Docker – Built for Each Other

Jenkins (or GitHub Actions) orchestrates the pipeline; Docker provides consistent, isolated environments for every step [citation:4].

Why they work together

  • Environmental consistency: Build runs in same containerized environment as production [citation:4]
  • Accelerated cycles: Lightweight containers spin up in seconds
  • Dependency management: Define once in Dockerfile, use everywhere
  • Jenkins + Docker Pipeline plugin: Build, tag, push images directly from pipeline

Example: GitHub Actions building Docker image

name: Build and Push Docker Image on: push: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Build Docker image run: docker build -t my-registry/lead-qualifier:${{ github.sha }} . - name: Push to Registry run: | docker push my-registry/lead-qualifier:${{ github.sha }}

☸️ CI/CD + Kubernetes – GitOps-Style Deployments

After building the Docker image, the pipeline updates your Kubernetes manifests and applies them [citation:6].

1

Build and push image (CI)

docker build -t my-registry/chatbot:${{ github.sha }} docker push my-registry/chatbot:${{ github.sha }}
2

Update Kubernetes manifest (CD)

Use tools like kubectl set image or update YAML files in a GitOps repo.

kubectl set image deployment/chatbot \ chatbot=my-registry/chatbot:${{ github.sha }} \ --record
3

Verify deployment

Run smoke tests against the new version.

GitOps pattern: Instead of `kubectl set image`, update the image tag in a Git repository and let ArgoCD or Flux sync to the cluster – fully auditable and reversible .

📱 Case Study: Full CI/CD Pipeline for Day 19 Chatbot

Your containerized chatbot needs automatic deployment whenever you push changes.

# .github/workflows/chatbot.yml name: Deploy Chatbot to Production on: push: branches: [ main ] paths: - 'chatbot/**' # Only run when chatbot code changes jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Run unit tests run: | cd chatbot python -m pytest tests/ build-and-push: needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push uses: docker/build-push-action@v4 with: context: ./chatbot push: true tags: my-registry/chatbot:${{ github.sha }} deploy-to-k8s: needs: build-and-push runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up kubectl uses: azure/setup-kubectl@v3 - name: Update deployment run: | kubectl set image deployment/chatbot \ chatbot=my-registry/chatbot:${{ github.sha }} - name: Verify deployment run: | kubectl rollout status deployment/chatbot

Result: Every push to main automatically tests, builds, and deploys your chatbot – fully hands-off [citation:1][citation:6].

🧠 AI-Specific CI/CD – Testing LLM Workflows

AI applications need special validation beyond unit tests [citation:2].

Pre-release validation

  • Use validation datasets to evaluate prompt changes
  • Measure metrics (accuracy, relevance, safety)
  • Block deployment if scores drop [citation:2]

Pre-production shadowing

  • Shadow subset of user traffic to new model
  • Compare metrics against current version
  • Proceed if improvements are confirmed [citation:2]

Production rollout

  • A/B testing with real user metrics
  • Canary deployments (5% → 20% → 100%)
  • Automated rollback on errors [citation:2]

Guardrails as tests

  • Integrate content filtering, PII detection
  • Test guardrail effectiveness in CI
  • Monitor denied response rates [citation:2]
# Example: Evaluate prompt performance in CI - name: Evaluate prompt on test set run: | python evaluate_prompts.py \ --test-set data/validation.json \ --min-accuracy 0.85

🤖 Agentic CI – AI That Fixes Its Own Builds

Cutting-edge CI pipelines now include AI agents that can diagnose and fix build failures [citation:5][citation:8].

Buildkite + Claude Code

When a PR build fails, an AI agent analyzes logs, implements a fix, and pushes a commit – all autonomously [citation:8].

Elastic's self-correcting monorepos

AI agents fix broken dependency updates in PRs, reducing human intervention by 90% [citation:5].

Future skill: Learn to integrate Claude Code, GitHub Copilot, or custom agents into CI pipelines. This is where DevOps meets AI [citation:5][citation:8].

🏗️ Infrastructure as Code – Deploy Environments, Not Just Apps

Use Terraform, CloudFormation, or Pulumi to manage your infrastructure through CI/CD [citation:2][citation:6].

# GitHub Actions + Terraform - name: Terraform Apply run: | cd terraform/prod terraform init terraform apply -auto-approve env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

Benefits: Version-controlled infrastructure, repeatable environments, disaster recovery [citation:6].

8 hands-on CI/CD exercises

📝 Exercise 1: First GitHub Action

Create a simple "hello world" Action that runs on push. Use GitHub's starter workflow.

🐳 Exercise 2: Build Docker image

Extend Exercise 1 to build a Docker image for your Day 8 qualifier. Push to Docker Hub.

🧪 Exercise 3: Add tests

Add a test stage that runs unit tests. Fail the pipeline if tests fail.

☸️ Exercise 4: Deploy to K8s

Add a stage that updates a Kubernetes deployment (use Minikube locally).

📊 Exercise 5: AI model validation

Create a script that evaluates prompt quality on a test set. Add to CI pipeline.

🔄 Exercise 6: Canary deployment

Implement a canary deployment that sends 10% traffic to new version. Use K8s service mesh.

🔧 Exercise 7: Terraform CI

Write a Terraform config for a simple resource. Create a pipeline that runs `terraform plan` on PR.

🤖 Exercise 8: Agentic CI experiment

Try Buildkite's Claude Code integration or implement a simple fixer bot using OpenAI API.

📄 Client Proposal – CI/CD Pipeline Implementation

⚡ CI/CD Automation Pipeline – Proposal

What I'll deliver:

  • ✅ Fully automated build-test-deploy pipeline for your AI systems
  • ✅ Docker image builds and container registry integration
  • ✅ Automated Kubernetes deployments with rollback capabilities
  • ✅ AI-specific validation (prompt testing, model evaluation) [citation:2]
  • ✅ Infrastructure as Code (Terraform) for environment consistency [citation:6]
  • ✅ Monitoring and alerting integration

Business benefits:

  • Deploy 10x faster – from days to minutes
  • Catch bugs before they reach production
  • Auditable, repeatable deployments
  • Developers focus on features, not deployments

Investment: $2,500 setup + $300/mo maintenance

📚 Resources

Bonus Module 3: You've mastered CI/CD for AI workflows

✔ Understood CI/CD fundamentals and tools
✔ Built pipelines that integrate Docker and Kubernetes
✔ Implemented AI-specific testing and validation [citation:2]
✔ Learned about agentic CI with self-healing pipelines [citation:5][citation:8]
✔ Created Infrastructure as Code workflows
✔ 8 hands-on exercises
✔ Ready to automate enterprise deployments

From code commit to production – fully automated

Bonus Module 3 – CI/CD for Automated Deployments

You need to be logged in to participate in this discussion.

×
×
×