mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 02:14:19 +08:00 
			
		
		
		
	Update yarn cache example (#70)
* Update yarn cache example * Update examples.md Co-Authored-By: Eric Taylor <erictaylor89@gmail.com>
This commit is contained in:
		
							parent
							
								
									f0cbadd748
								
							
						
					
					
						commit
						50a2fdee6f
					
				| @ -112,12 +112,17 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o | ||||
| ``` | ||||
| 
 | ||||
| ## Node - Yarn | ||||
| The yarn cache directory will depend on your operating system and version of `yarn`. See https://yarnpkg.com/lang/en/docs/cli/cache/ for more info. | ||||
| 
 | ||||
| ```yaml | ||||
| - name: Get yarn cache | ||||
|   id: yarn-cache | ||||
|   run: echo "::set-output name=dir::$(yarn cache dir)" | ||||
| 
 | ||||
| - uses: actions/cache@v1 | ||||
|   with: | ||||
|     path: ~/.cache/yarn | ||||
|     key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} | ||||
|     path: ${{ steps.yarn-cache.outputs.dir }} | ||||
|     key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||||
|     restore-keys: | | ||||
|       ${{ runner.os }}-yarn- | ||||
| ``` | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Josh Gross
						Josh Gross