How to cache npm dependencies in GitHub action?

Below is my dockerfile. Is there a way to cache npm in GitHub action?

FROM node
WORKDIR /app
ADD package*.json ./
RUN npm ci
ENV PATH /app/node_modules/.bin:$PATH

My GitHub actions:

name: NPM buid

on:
  push:
    branches:
      - main
jobs:
  build-npm-image:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Build and Tag Node image
        id: build-ui-image
        run: |
          export DOCKER_BUILDKIT=1
          docker build -t ui -f ./ui/Dockerfile .

P.S I don’t want to cache docker image. Above docker file is used just for example. objection is cache npm dependencies