CI/CD pipeline – DEV Community
December 23, 2024

CI/CD pipeline – DEV Community

CI/CD (automated construction and deployment) for Kubernetes
GitHub Actions/Jenkins: Automate Docker setup and K8s deployment.
GitHub operation example:
yaml
Copy code
Name: CI/CD Pipeline
exist: [push]
Position:
Build and deploy:
Run: ubuntu-latest
step:
– Use: 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 sets image deployment/myapp-deployment myapp=username/myapp:${{ github.sha }}

2024-12-23 08:17:58

Leave a Reply

Your email address will not be published. Required fields are marked *