DEV Community

Anjali Gurjar
Anjali Gurjar

Posted on

CI/CD pipeline

CI/CD for Kubernetes (Automate Builds and Deployments)
GitHub Actions / Jenkins: Automate Docker builds and K8s deployments.
Example GitHub Action:
yaml
Copy code
name: CI/CD Pipeline
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker Image
run: docker build -t username/myapp:${{ github.sha }} .
- name: Push to Docker Hub
run: docker push username/myapp:${{ github.sha }}
- name: Deploy to K8s
run: |
kubectl set image deployment/myapp-deployment myapp=username/myapp:${{ github.sha }}

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more