CI/CD Pipelines

22 / 30
1 min read
1

CI/CD Pipelines

Continuous Integration (CI) and Continuous Deployment (CD) automate testing and releasing code.

Continuous Integration

Developers merge code into a shared branch frequently. Each merge triggers automated tests so bugs are caught early.

Continuous Deployment

After tests pass, the code is automatically built and deployed to staging or production.

GitHub Actions Basics

A workflow lives in .github/workflows/ and is made of jobs and steps:

yaml
name: CI
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
// ...

Best Practices

  • Keep builds fast and deterministic.
  • Run unit tests before integration tests.
  • Store secrets (tokens, keys) in GitHub Secrets, never in the repository.
  • Use deployment gates or manual approvals for production.

Comprehension check

Answer all 3 questions correctly to unlock Submit.

1What is the primary goal of Continuous Integration?

2In GitHub Actions, where are workflow files stored?

3Where should sensitive values like API keys be stored in a CI pipeline?