From e7f696112e6e9d8174f2bae3974fbf8e04448ad8 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Thu, 4 Mar 2021 10:27:37 +0100 Subject: [PATCH] Install node_modules in build-docs.yml --- .github/workflows/build-docs.yml | 40 ++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 2a3956c..4367492 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -15,16 +15,26 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '12.x' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install modules + run: yarn install --frozen-lockfile + - name: Install modules (example/) + run: yarn example --frozen-lockfile + - name: Test Build run: | - if [ -e yarn.lock ]; then yarn install --frozen-lockfile - elif [ -e package-lock.json ]; then - npm ci - else - npm i - fi - npm run build + yarn build gh-release: if: github.event_name != 'pull_request' runs-on: ubuntu-latest @@ -46,6 +56,22 @@ jobs: HostName github.com IdentityFile ~/.ssh/id_rsa EOT + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install modules + run: yarn install --frozen-lockfile + - name: Install modules (example/) + run: yarn example --frozen-lockfile + - name: Release to GitHub Pages env: USE_SSH: true