What is GitHub Actions and how does it work?

Answer

GitHub Actions is GitHub's built-in CI/CD platform that automates workflows directly in your repository. Workflows are defined in YAML files placed in .github/workflows/. A workflow is triggered by events (e.g., push, pull_request, schedule, workflow_dispatch). Each workflow contains one or more jobs that run on runners (GitHub-hosted VMs or self-hosted machines). Each job contains a sequence of steps — either shell commands (run:) or pre-built Actions (uses: actions/checkout@v4). Jobs can run in parallel or sequentially using needs: dependencies. GitHub Actions has a marketplace of thousands of community Actions for common tasks (deploy to AWS, send Slack notifications, etc.).