A developer commits code to a GitHub repository and wants automated tests to run, followed by building a Docker image and pushing it to Docker Hub only if tests pass. Which CI/CD tool can be configured using a YAML file placed in the .github/workflows directory?
Correct. GitHub Actions workflows are defined in .github/workflows.
Why this answer
GitHub Actions is the only CI/CD tool among the options that uses a YAML workflow file placed in the `.github/workflows` directory within the repository. This allows developers to define automated triggers (e.g., on push) to run tests, build a Docker image, and push it to Docker Hub only if tests pass, all natively integrated with GitHub.
Exam trap
The trap here is that candidates may confuse the directory structure for different CI/CD tools (e.g., `.circleci/config.yml` for CircleCI or `.gitlab-ci.yml` for GitLab CI) and incorrectly assume any YAML-based CI tool can use the `.github/workflows` path, which is exclusive to GitHub Actions.
How to eliminate wrong answers
Option A is wrong because Jenkins uses a `Jenkinsfile` (typically Groovy-based) and does not read YAML files from `.github/workflows`; it requires its own server or agent configuration. Option B is wrong because CircleCI uses a `.circleci/config.yml` file placed in the `.circleci` directory, not `.github/workflows`. Option D is wrong because GitLab CI uses a `.gitlab-ci.yml` file placed in the root of the repository, not in a `.github/workflows` directory, and is designed for GitLab repositories, not GitHub.