diff --git a/.github/workflows/pr-check_redirects.yml b/.github/workflows/pr-check_redirects.yml index 46eacf442af3251..055d2e218bd57b2 100644 --- a/.github/workflows/pr-check_redirects.yml +++ b/.github/workflows/pr-check_redirects.yml @@ -20,19 +20,18 @@ jobs: with: node-version: "12" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2.1.4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Cache node_modules + uses: actions/cache@v2.1.4 + id: cached-node_modules with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + path: | + node_modules + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Install all yarn packages - run: yarn --frozen-lockfile + if: steps.cached-node_modules.outputs.cache-hit != 'true' + run: | + yarn --frozen-lockfile - name: Check redirects file(s) run: yarn content validate-redirects en-us --strict diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index dfc89bcfb33c672..351ad307c5374df 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -19,19 +19,18 @@ jobs: with: node-version: "12" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2.1.4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Cache node_modules + uses: actions/cache@v2.1.4 + id: cached-node_modules with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + path: | + node_modules + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Install all yarn packages - run: yarn --frozen-lockfile + if: steps.cached-node_modules.outputs.cache-hit != 'true' + run: | + yarn --frozen-lockfile - name: Start the Yari server run: |