From 63f49d5c0d607e78b9e883a411de99532cb5f4ef Mon Sep 17 00:00:00 2001 From: Ritvik Nag Date: Sun, 11 Feb 2024 16:12:09 -0500 Subject: [PATCH] fix stupid stuff --- .github/workflows/publish.yaml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 98f011e..391ed44 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -57,9 +57,21 @@ jobs: with: node-version: 18 cache: 'npm' + - name: Cache global node modules + uses: actions/cache@v4 + id: global-npm-cache + env: + cache-name: cache-global-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - name: Cache node modules id: npm-cache - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: @@ -73,11 +85,12 @@ jobs: - name: List the state of node modules continue-on-error: true run: npm list - - name: Install dependencies + - name: Install Global Dependencies + if: ${{ steps.global-npm-cache.outputs.cache-hit != 'true' }} + run: npm i -g surge + - name: Install Dependencies if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }} - run: | - npm i -g surge - npm ci + run: npm ci - name: Build and Deploy to Surge run: | npm run build