https://github.com/IITC-College/cicd-lab05-using-cache

Part 1 — Create the Dependency Preparation Job

Tasks

  1. Create the Workflow file:
.github/workflows/ci.yml
  1. Configure Workflow triggers:
  2. Create a Job named prepare-dependencies
  3. Configure the Job to run on ubuntu-latest
  4. Add a checkout step using actions/checkout@v4
  5. Add a Cache step using actions/cache@v4
  6. Give the Cache step an id named node-modules-cache
  7. Configure the Cache step:
  8. Add an installation step running:
npm ci
  1. Add an if: condition to the installation step:
steps.node-modules-cache.outputs.cache-hit
- Understand the condition:
    - If Cache Hit = `true`
    - Skip `npm ci`
    - If Cache Miss = run `npm ci`
  1. Push the Workflow and inspect the logs:
Cache not found for key...