What are GitHub Actions?
Why Interviewers Ask This
This tests whether you can apply Git & GitHub knowledge to real-world scenarios. Interviewers are looking for clarity of thought and evidence that you've encountered this in production code.
Answer
GitHub Actions is GitHub's built-in CI/CD automation platform. It allows you to automate workflows (build, test, deploy, notify) triggered by GitHub events (push, pull_request, schedule, release). Workflows are defined in YAML files in .github/workflows/. Key components: Workflow — a YAML file defining the automation; Event — what triggers the workflow (push to main, PR opened, scheduled cron); Job — a unit of work running on a virtual machine (ubuntu-latest, windows-latest, macos-latest); Step — individual task within a job (run a command or use an action); Action — reusable unit of code from the marketplace (actions/checkout, actions/setup-node). Example workflow: on: [push]\njobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - uses: actions/setup-node@v4\n with:\n node-version: "20"\n - run: npm ci\n - run: npm test. Features: parallel jobs, job dependencies, matrix builds (test across multiple OS/versions), artifacts, caching (speed up builds by caching node_modules), secrets management, environment deployments, required status checks for branch protection.
Pro Tip
Before answering, structure your response: one-line definition → real-world analogy → concrete example from a project. This makes even complex Git & GitHub answers easy to follow.