Just add this simple step to the workflow before checkout:
- name: Cache node modules id: cache uses: actions/cache@v2 with: path: node_modules key: node_modules-cache