From a46568ca707902340ef6f9b0f6c4a9447b95e303 Mon Sep 17 00:00:00 2001 From: Kian Newman-Hazel Date: Fri, 11 Oct 2024 16:20:39 +0100 Subject: [PATCH 1/2] [Docs Site] Cache Astro assets in ci.yml --- .github/workflows/ci.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c24df4d685f2a1..b68dae8cb7d4a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,19 +20,13 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 - - - name: Get npm cache directory - id: npm-cache-dir - shell: bash - run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} - - - uses: actions/cache@v4 - id: npm-cache + cache: "npm" + - uses: actions/cache/restore@v4 with: - path: ${{ steps.npm-cache-dir.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- + path: | + node_modules/.astro/_astro + node_modules/.astro/assets + key: static - run: npm ci - run: npm run check @@ -44,5 +38,12 @@ jobs: NODE_OPTIONS: "--max-old-space-size=4192" RUN_LINK_CHECK: true + - uses: actions/cache/save@v4 + with: + path: | + node_modules/.astro/_astro + node_modules/.astro/assets + key: static + - name: Check - Validate redirects (infinite loops, sources with fragment) run: npx tsm bin/validate-redirects.ts From 83beabb421818008092099f942458798ac58786c Mon Sep 17 00:00:00 2001 From: Kian Newman-Hazel Date: Tue, 15 Oct 2024 14:18:42 +0100 Subject: [PATCH 2/2] Cache whole Astro folder --- .github/workflows/ci.yml | 6 ++---- .github/workflows/publish-preview.yml | 6 ++---- .github/workflows/publish-production.yml | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b68dae8cb7d4a4..2746da3554b3ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,7 @@ jobs: - uses: actions/cache/restore@v4 with: path: | - node_modules/.astro/_astro - node_modules/.astro/assets + node_modules/.astro key: static - run: npm ci @@ -41,8 +40,7 @@ jobs: - uses: actions/cache/save@v4 with: path: | - node_modules/.astro/_astro - node_modules/.astro/assets + node_modules/.astro key: static - name: Check - Validate redirects (infinite loops, sources with fragment) diff --git a/.github/workflows/publish-preview.yml b/.github/workflows/publish-preview.yml index a8820ae842f5c7..2cdc11940a34b1 100644 --- a/.github/workflows/publish-preview.yml +++ b/.github/workflows/publish-preview.yml @@ -23,8 +23,7 @@ jobs: - uses: actions/cache/restore@v4 with: path: | - node_modules/.astro/_astro - node_modules/.astro/assets + node_modules/.astro key: static - run: npx astro build env: @@ -42,6 +41,5 @@ jobs: if: always() with: path: | - node_modules/.astro/_astro - node_modules/.astro/assets + node_modules/.astro key: static diff --git a/.github/workflows/publish-production.yml b/.github/workflows/publish-production.yml index 7cc74945289f13..85dfc8edd353ea 100644 --- a/.github/workflows/publish-production.yml +++ b/.github/workflows/publish-production.yml @@ -19,8 +19,7 @@ jobs: - uses: actions/cache/restore@v4 with: path: | - node_modules/.astro/_astro - node_modules/.astro/assets + node_modules/.astro key: static - run: npx astro build env: @@ -34,6 +33,5 @@ jobs: if: always() with: path: | - node_modules/.astro/_astro - node_modules/.astro/assets + node_modules/.astro key: static