From ff570b1732c11242c958eabac67db075c712d184 Mon Sep 17 00:00:00 2001 From: Greg Walker Date: Sat, 16 Sep 2023 19:19:17 -0500 Subject: [PATCH] oop x 8 --- .github/workflows/integrity-check.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integrity-check.yml b/.github/workflows/integrity-check.yml index 3483d3252..be089b68f 100644 --- a/.github/workflows/integrity-check.yml +++ b/.github/workflows/integrity-check.yml @@ -10,14 +10,24 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - id: cache_key + run: echo "cache_key=${{ hashFiles('**/**') }}-v1" >> "$GITHUB_OUTPUT" + + - uses: actions/cache@v3 + id: cache + with: + path: . + key: ${{ steps.cache_key.outputs.cache_key }} + + - if: steps.cache.outputs.cache-hit != true + uses: actions/setup-node@v3 with: node-version: 18 - - name: install dependencies - run: npm ci + - if: steps.cache.outputs.cache-hit != true + run: npm install - - name: build site + - if: steps.cache.outputs.cache-hit != true env: ELEVENTY_ENV: production run: npm run build @@ -64,7 +74,7 @@ jobs: siteFiles.map(async (filePath) => { const file = await fs.readFile(filePath); const hash = md5(file); - return [hash, filePath.replace(/$_site\//, "")]; + return [hash, filePath.replace(/^_site\//, "")]; }) ); @@ -89,6 +99,7 @@ jobs: if (expectedHash !== remoteHash) { mismatch.push({ expectedHash, remoteHash, url }); } + await sleep(500); }