From 89b97412c4905d530b80659938abca467adc54a9 Mon Sep 17 00:00:00 2001 From: Mahesh-wor 'Invoron <72002075+mahesh-naxa@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:49:02 +0545 Subject: [PATCH] actions: cache-dependency-path added for varying managers --- .github/workflows/nextjs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml index d0abea17..359af224 100644 --- a/.github/workflows/nextjs.yml +++ b/.github/workflows/nextjs.yml @@ -34,7 +34,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Detect package manager id: detect-package-manager run: | @@ -42,11 +41,13 @@ jobs: echo "manager=yarn" >> $GITHUB_OUTPUT echo "command=install" >> $GITHUB_OUTPUT echo "runner=yarn" >> $GITHUB_OUTPUT + echo "path=frontend/yarn.lock" >> $GITHUB_OUTPUT exit 0 elif [ -f "${{ github.workspace }}/frontend/package.json" ]; then echo "manager=npm" >> $GITHUB_OUTPUT echo "command=ci" >> $GITHUB_OUTPUT echo "runner=npx --no-install" >> $GITHUB_OUTPUT + echo "path=frontend/package.json" >> $GITHUB_OUTPUT exit 0 else echo "Unable to determine package manager" @@ -57,6 +58,7 @@ jobs: with: node-version: "16" cache: ${{ steps.detect-package-manager.outputs.manager }} + cache-dependency-path: ${{ steps.detect-package-manager.outputs.path }} - name: Setup Pages uses: actions/configure-pages@v3 with: