From 116cc389353a1ca16c2afa679cc6e5ae247c346b Mon Sep 17 00:00:00 2001 From: trigoporres Date: Fri, 8 Nov 2024 13:15:08 +0100 Subject: [PATCH] build: add cache release workflow --- .github/workflows/release.yml | 67 ++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7745aea2..894e97d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,8 +33,25 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧 - uses: ./.github/workflows/setup-node + - name: Cache node modules + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: | + node_modules + ~/.npm + **/dist + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + - name: Set Node v20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + registry-url: https://registry.npmjs.org/ + - name: Install dependencies + run: npm ci - name: Generate dist run: npm run build @@ -47,8 +64,17 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧 - uses: ./.github/workflows/setup-node + - name: Use node modules cache + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: | + node_modules + ~/.npm + **/dist + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - name: Run linter run: npm run lint @@ -61,8 +87,17 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧 - uses: ./.github/workflows/setup-node + - name: Use node modules cache + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: | + node_modules + ~/.npm + **/dist + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - name: Run tests run: npm run test:ci @@ -76,9 +111,23 @@ jobs: with: fetch-depth: 0 - - name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧 - uses: ./.github/workflows/setup-node - + - name: Set node v20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + registry-url: https://registry.npmjs.org/ + - name: Use node modules cache + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: | + node_modules + ~/.npm + **/dist + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - name: Setup Git config run: | git config --global user.name 'Devo GitHub Action'