CI/CD Basics
Definition
Continuous Integration and Continuous Deployment. The automated process of testing, building, and deploying code to production every time a developer commits changes to a code repository.
Explain Like I'm New
In the old days, deploying a website meant freezing development on Friday, manually running tests, FTPing files to a server, and praying nothing broke. CI/CD automates this entirely. When you `git push` to GitHub, an automated robot (like GitHub Actions) wakes up. It runs your Jest tests (CI). If they pass, it automatically logs into your AWS server, downloads the new code, and restarts PM2 (CD). You can deploy 50 times a day safely.
Real World Example
Setting up a `.github/workflows/deploy.yml` file. Every time a Pull Request is merged into the `main` branch, the code is automatically pushed live to production within 2 minutes.
Common Use Cases
- •Automated testing
- •Agile development
- •Preventing human error during deployments
Terminal Output
Interview Questions
basic
- What does the 'CI' stand for, and what is its main goal?
intermediate
- What happens if a Unit Test fails during the CI pipeline?