mirror of
				https://github.com/actions/cache.git
				synced 2025-11-03 22:58:39 +08:00 
			
		
		
		
	Update examples.md
This commit is contained in:
		
							parent
							
								
									d1255ad936
								
							
						
					
					
						commit
						19530ba135
					
				| 
						 | 
				
			
			@ -194,12 +194,13 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
 | 
			
		|||
 | 
			
		||||
```yaml
 | 
			
		||||
- name: Get npm cache directory
 | 
			
		||||
  id: npm-cache
 | 
			
		||||
  id: npm-cache-dir
 | 
			
		||||
  run: |
 | 
			
		||||
    echo "::set-output name=dir::$(npm config get cache)"
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
 | 
			
		||||
  with:
 | 
			
		||||
    path: ${{ steps.npm-cache.outputs.dir }}
 | 
			
		||||
    path: ${{ steps.npm-cache-dir.outputs.dir }}
 | 
			
		||||
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-node-
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user