diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml index d63a188..1b8e453 100644 --- a/.github/workflows/nextjs.yml +++ b/.github/workflows/nextjs.yml @@ -31,6 +31,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Detect package manager id: detect-package-manager run: | @@ -48,19 +49,16 @@ jobs: echo "Unable to determine package manager" exit 1 fi + - name: Setup Node uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "lts/*" cache: ${{ steps.detect-package-manager.outputs.manager }} + - name: Setup Pages - uses: actions/configure-pages@v5 - with: - # Automatically inject basePath in your Next.js configuration file and disable - # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). - # - # You may remove this line if you want to manage the configuration yourself. - static_site_generator: next + uses: actions/configure-pages@v4 + - name: Restore cache uses: actions/cache@v4 with: @@ -71,12 +69,13 @@ jobs: # If source files changed but packages didn't, rebuild from a prior cache. restore-keys: | ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + - name: Install dependencies run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + - name: Build with Next.js run: ${{ steps.detect-package-manager.outputs.runner }} next build - - name: Ensure out directory exists - run: mkdir -p ./out + - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: @@ -92,4 +91,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v4 \ No newline at end of file