main.yml 738 B

12345678910111213141516171819202122
  1. - name: Get npm cache directory
  2. id: npm-cache
  3. run: |
  4. echo "::set-output name=dir::$(npm config get cache)"
  5. - uses: actions/cache@v1
  6. with:
  7. path: ${{ steps.npm-cache.outputs.dir }}
  8. key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  9. restore-keys: |
  10. ${{ runner.os }}-node-
  11. - name: Get yarn cache directory path
  12. id: yarn-cache-dir-path
  13. run: echo "::set-output name=dir::$(yarn cache dir)"
  14. - uses: actions/cache@v1
  15. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  16. with:
  17. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  18. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  19. restore-keys: |
  20. ${{ runner.os }}-yarn-