# Monitoring & Rollback — CI/CD Fundamentals: Pipelines, Testing and Deployment

Source: https://www.skillbyai.com/en/cicd/cicd-observability

> Confirm every deploy is healthy with monitoring and health checks, and roll back fast to the last good artifact.

## Watch the deploy, not just the pipeline

A green pipeline only proves the code built and passed tests — it says nothing about production. After deploy, watch error rates, latency, and key business metrics for a window before calling it 'done'.

## Rollback strategies

When something breaks, the fastest fix is usually to **roll back** to the last known-good artifact — not to debug live in production. Blue-green makes this instant; rolling deployments roll the batches back the same gradual way.

## Automate the trigger

Mature pipelines wire health checks and error-rate alerts to trigger an automatic rollback, instead of waiting for a human to notice and act at 2 a.m.

## Final quiz 1 of 8

Final quiz

**Quiz:** What is continuous integration?

- [ ] Deploying once a year
- [ ] Manual testing only
- [x] Merging often and verifying each change automatically
- [ ] Branching for months

*Answer:* Merging often and verifying each change automatically. Small frequent merges reduce conflicts.

## Final quiz 2 of 8

Final quiz

**Quiz:** What separates continuous delivery from continuous deployment?

- [ ] Delivery has no tests
- [ ] Deployment skips builds
- [ ] They are identical
- [x] A human approves the production release in delivery

*Answer:* A human approves the production release in delivery. Deployment releases every passing change automatically.

## Final quiz 3 of 8

Final quiz

**Quiz:** Why build an artifact only once?

- [x] So the exact tested output is what gets deployed
- [ ] To save disk space only
- [ ] To skip tests
- [ ] Because builds are random

*Answer:* So the exact tested output is what gets deployed. Rebuilding at each stage can change the result.

## Final quiz 4 of 8

Final quiz

**Quiz:** Why pin a GitHub Action to a version tag or SHA?

- [ ] It runs faster
- [x] A branch reference can change unexpectedly
- [ ] Branches are not allowed
- [ ] It hides logs

*Answer:* A branch reference can change unexpectedly. Pinning prevents surprise or malicious updates.

## Final quiz 5 of 8

Final quiz

**Quiz:** Which checks should run first in a fail-fast pipeline?

- [ ] Production deploy
- [ ] Slow end-to-end tests
- [x] Fast, cheap ones like linting and unit tests
- [ ] Manual sign-off

*Answer:* Fast, cheap ones like linting and unit tests. Cheap failures save time and money.

## Final quiz 6 of 8

Final quiz

**Quiz:** Which strategy needs no duplicate full environment?

- [ ] Blue-green
- [ ] Both
- [ ] Neither
- [x] Rolling deployment

*Answer:* Rolling deployment. Rolling replaces instances in batches.

## Final quiz 7 of 8

Final quiz

**Quiz:** Where should CI secrets live?

- [x] In the CI system's encrypted secret store
- [ ] In the repository code
- [ ] In README files
- [ ] In the build artifact

*Answer:* In the CI system's encrypted secret store. Never commit credentials to git.

## Final quiz 8 of 8

Final quiz

**Quiz:** What should happen after a deploy?

- [ ] Nothing
- [x] Monitor health and roll back if needed
- [ ] Delete logs
- [ ] Skip alerts

*Answer:* Monitor health and roll back if needed. A deploy is done when it is confirmed healthy.
