From 1e22f83abc181ea63b4f2fc075696036cb949e05 Mon Sep 17 00:00:00 2001 From: Jwaegebaert <38426621+Jwaegebaert@users.noreply.github.com> Date: Sun, 17 Dec 2023 19:53:20 +0100 Subject: [PATCH] Actions caching dependencies for Docusaurus builds --- .github/workflows/check_pr.yml | 13 +++++++++++-- .github/workflows/release.yml | 11 ++++++++++- .github/workflows/release_next.yml | 11 ++++++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index 01de31e8306..2d2a8685802 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -118,10 +118,19 @@ jobs: with: node-version: 18 - - name: Install dependencies + - name: Cache node modules + id: cache + uses: actions/cache@v3 + with: + path: | + **/docs/node_modules + key: docs_node_modules-${{ hashFiles('**/docs/package-lock.json') }} + + - name: Restore dependencies + if: steps.cache.outputs.cache-hit != 'true' run: npm ci working-directory: docs - name: Build docs run: npm run build - working-directory: docs + working-directory: docs \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 780489640cc..e910876631d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,7 +86,16 @@ jobs: with: node-version: 18 - - name: Install dependencies + - name: Cache node modules + id: cache + uses: actions/cache@v3 + with: + path: | + **/docs/node_modules + key: docs_node_modules-${{ hashFiles('**/docs/package-lock.json') }} + + - name: Restore dependencies + if: steps.cache.outputs.cache-hit != 'true' run: npm ci working-directory: docs diff --git a/.github/workflows/release_next.yml b/.github/workflows/release_next.yml index a11e9d5c51a..b8fa8f25e80 100644 --- a/.github/workflows/release_next.yml +++ b/.github/workflows/release_next.yml @@ -123,7 +123,16 @@ jobs: with: node-version: 18 - - name: Install dependencies + - name: Cache node modules + id: cache + uses: actions/cache@v3 + with: + path: | + **/docs/node_modules + key: docs_node_modules-${{ hashFiles('**/docs/package-lock.json') }} + + - name: Restore dependencies + if: steps.cache.outputs.cache-hit != 'true' run: npm ci working-directory: docs