title: How to clear cache in GitLab CI?
body: <p>In the docs I've learned that I can clear cache by including <code>cache: {}</code> into my gitlab-ci.yml file like so:</p>
  
  <p><a href="https://i.stack.imgur.com/7PF5a.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7PF5a.gif" alt="enter image description here"></a></p>
  
  <p>I must be using it wrong though because this is what I read in build output:</p>
  
  <p><a href="https://i.stack.imgur.com/GWRVM.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GWRVM.gif" alt="enter image description here"></a></p>
  
  <p>I've got problem with this because few lines down I replaced <code>npm ci</code> with <code>npm install --no-optional</code> and the GitLab runner keeps calling <code>npm ci</code></p>
  
  <p>Any suggestions ?</p>
  
  <p>Dockerfile:</p>
  
  <pre><code>###########
  # BUILDER #
  ###########
  
  FROM node:11.12.0-alpine as builder
  
  WORKDIR /usr/src/app
  
  ENV PATH /usr/src/app/node_modules/.bin:$PATH
  COPY package.json /usr/src/app/package.json
  COPY package-lock.json /usr/src/app/package-lock.json
  RUN npm install --no-optional
  RUN npm install react-scripts@2.1.8 -g --silent --no-optional
  ARG REACT_APP_USERS_SERVICE_URL
  ENV REACT_APP_USERS_SERVICE_URL $REACT_APP_USERS_SERVICE_URL
  ARG NODE_ENV
  ENV NODE_ENV $NODE_ENV
  
  
  COPY . /usr/src/app
  RUN npm run build
  </code></pre>