Domain 5: CI/CD Patterns & Optimization
GitHub Actions · 52 questions
- When using 'actions/cache', what happens if no cache entry matches the primary key?
- Which cache key strategy ensures the npm cache is invalidated when package-lock.json changes?
- Which action pair is used to share build artifacts between jobs in the same workflow?
- What is the default artifact retention period for GitHub Actions on public repositories?
- How do you set the deployment URL shown in the GitHub deployment environment view after a successful deployment job?
- What must you configure in repository settings to prevent merging a PR if the 'CI / build' check fails?
- How do you limit the number of simultaneous jobs in a matrix strategy to 3?
- Which GitHub-hosted runner OS has a billing minute multiplier greater than 1x?
- How do you enable step debug logging in GitHub Actions to get more verbose output?
- Where in the GitHub UI can you see a visual graph of your workflow's job execution and dependencies?
- When using 'actions/setup-node' with 'cache: npm', what files does it use to generate the cache key?
- In a GitHub Actions CI/CD pipeline, what pattern ensures 'deploy to staging' always runs before 'deploy to production'?
- How do you write a Markdown summary that appears on the workflow run summary page?
- Which GitHub CLI command triggers a workflowdispatch event from the command line?
- Using the GitHub REST API, which endpoint lists workflow runs for a specific workflow?
- Which branches can access caches created in a GitHub Actions workflow?
- What is the benefit of using 'Re-run failed jobs' instead of 'Re-run all jobs' after a workflow failure?
- When building Docker images in GitHub Actions, which feature of 'docker/build-push-action' speeds up builds by caching Docker layers?
- Which URL pattern generates a GitHub Actions workflow status badge for a specific workflow?
- A deploy job creates a unique preview URL per PR. How should you capture and display this URL in GitHub's deployment environment view?
- What is the maximum size of a single cache entry in GitHub Actions?
- Which actions/cache behavior occurs when the primary key is a cache miss but a restore-key partially matches?
- By default, can 'actions/download-artifact' access artifacts from a different workflow run?
- What is the GitHub-native mechanism to pause a CI/CD pipeline and wait for human approval before proceeding?
- Using the GitHub REST API or CLI, how do you disable a workflow so it no longer triggers?
- In actions/upload-artifact@v4, what happens if two parallel jobs upload artifacts with the same name?
- Which GitHub feature, combined with required status checks, enables automatically merging PRs when all checks pass?
- In actions/download-artifact@v4, what does the 'merge-multiple: true' parameter do?
- Job 'build' uploads an artifact with actions/upload-artifact. Job 'test' in the same workflow needs those files. What must 'test' do?
- A primary cache key is 'Linux-npm-a1b2c3'. Which restore-keys entry best allows falling back to the most recent Linux npm cache when the exact key misses?
- After deploying a preview app, you want the GitHub deployment to show a clickable environment URL. Which job-level configuration surfaces that URL in the GitHub UI?
- Which two practices help ensure pull requests cannot merge until CI has validated them? (Choose two)
- A monorepo workflow should run only when files under 'backend/' change on push. Which trigger configuration implements that path filter?
- Your matrix expands to 12 jobs but the external test service allows only 4 concurrent sessions. How do you limit concurrency of matrix jobs to 4?
- You implement a manual deploy workflow with workflowdispatch. Operators must pick the target environment from staging or production. Which input definition is most appropriate?
- A 'build' job computes whether a deploy is necessary and sets output 'shoulddeploy' to 'true' or 'false'. How should the 'deploy' job skip work when the value is 'false'?
- You want CI on push when application code changes, but not when only Markdown under 'docs/' changes. Which configuration is appropriate?
- You cache npm dependencies with primary key 'npm-${{ runner.os }}-${{ hashFiles('/package-lock.json') }}' and restore-keys starting with 'npm-${{ runner.os }}-'. What happens on a lockfile change?
- Job 'build' uploads artifact 'web-dist'. Job 'deploy' has needs: [build]. How should deploy obtain the files?
- After deploying a preview app, you want GitHub to show the live URL on the environment and still require a reviewer before production. Which combination applies?
- Base matrix is node: [18, 20] on ubuntu-latest. You need one additional job: node 20 on windows-latest with env flag SLOWTESTS=1. What is the cleanest matrix approach?
- Which two techniques most directly reduce average CI minutes without sacrificing correctness? (Choose two.)
- In a monorepo, each service should run the same CI jobs when its directory changes. Which design is most maintainable?
- Feature branch builds restore caches created on the default branch but have limited ability to pollute default-branch caches. Why do teams still prefer saving warm caches from main/default CI?
- Your release workflow should produce a Software Bill of Materials for compliance. Which Actions approach best fits?
- What does progressive delivery mean in a GitHub Actions deployment context?
- How can GitHub Environments help implement a blue-green style deployment workflow in Actions?
- Why do monorepo teams combine path filters with separate workflows per package for CI optimization?
- A cache entry was saved during a workflow on the repository default branch. A later workflow on a feature branch uses the same cache key. What is the expected access behavior?
- A production environment uses a wait timer of 10 minutes as a protection rule. What is the effect on a deploy job that references that environment?
- Which two techniques commonly reduce GitHub Actions feedback time without sacrificing necessary checks? (Choose two.)
- Your CI uploads large integration-test reports on every PR. Storage costs grow quickly. Which upload-artifact configuration most directly limits how long those reports consume artifact storage?