Browse Source

Update nextjs.yml

Aykut Saraç 2 years ago
parent
commit
1de7110be5
1 changed files with 9 additions and 1 deletions
  1. 9 1
      .github/workflows/nextjs.yml

+ 9 - 1
.github/workflows/nextjs.yml

@@ -35,7 +35,7 @@ jobs:
         run: |
           if [ -f "${{ github.workspace }}/yarn.lock" ]; then
             echo "manager=yarn" >> $GITHUB_OUTPUT
-            echo "command=install" >> $GITHUB_OUTPUT
+            echo "command=install --frozen-lockfile --production" >> $GITHUB_OUTPUT
             echo "runner=yarn" >> $GITHUB_OUTPUT
             exit 0
           elif [ -f "${{ github.workspace }}/package.json" ]; then
@@ -52,6 +52,14 @@ jobs:
         with:
           node-version: "16"
           cache: ${{ steps.detect-package-manager.outputs.manager }}
+      - name: Cache node_modules
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.npm
+            ~/.cache/yarn
+          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
+          restore-keys: ${{ runner.os }}-node-
       - name: Setup Pages
         uses: actions/configure-pages@v3
         with: