Caching Jekyll _site files not working

I’m trying to cache my _site files when I build my Jekyll site using this:

  # Use GitHub Actions' cache to cache site on servers
  - uses: actions/cache@v2
      path: _site
      key: ${{ runner.os }}-site-${{ hashFiles('**/index.html') }}
      restore-keys: |
        ${{ runner.os }}-site-

Unfortunately when it runs I get:

Received 22 of 22 (100.0%), 0.0 MBs/sec
Cache Size: ~0 MB (22 B).

Not clear what’s going wrong. Is the path incorrect?

I don’t think that Jekyll can utilize what it previously generated if you cache the _site folder. You should cache the folder .jekyll-cache and if it exists also the file .jekyll-metadata (haven’t seen it on Windows, but on Linux). Maybe cache the _site in addition, not sure if it makes a difference.