chore: improve caching of yarn on gh actions

This commit is contained in:
Satyajit Sahoo
2020-05-27 13:14:08 +02:00
parent 9016ba00e3
commit 717dffdb81
2 changed files with 16 additions and 19 deletions

View File

@@ -23,20 +23,18 @@ jobs:
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
expo-cache: true
- name: Get yarn cache
- name: Restore yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Check yarn cache
uses: actions/cache@v1
uses: actions/cache@master
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Publish Expo app
working-directory: ./example

View File

@@ -25,19 +25,18 @@ jobs:
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
expo-cache: true
- name: Get yarn cache
- name: Restore yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
uses: actions/cache@master
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Publish Expo app
working-directory: ./example