From b5a466a4f7555c5535f90612ecfa2ffff93fcd85 Mon Sep 17 00:00:00 2001 From: cnnmon Date: Tue, 25 Jun 2024 16:23:55 -0700 Subject: [PATCH] Fix nextjs.yml Create test.txt Create test.txt Update nextjs.yml Revert "Create nextjs.yml" This reverts commit 2b8e593cb8cb0c2ab09faa4faa687970610ebeca. Reapply "Create nextjs.yml" This reverts commit b116bdce5904867bec30bdf06f73bb1fdf3f4768. Revert "Reapply "Create nextjs.yml"" This reverts commit 71b3ac9c1b86c51d30fb3e0d22741873be20d16d. --- .github/workflows/nextjs.yml | 21 ++++++++++----------- next.config.js | 2 ++ 2 files changed, 12 insertions(+), 11 deletions(-) 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 diff --git a/next.config.js b/next.config.js index 79760cf..8f46f37 100644 --- a/next.config.js +++ b/next.config.js @@ -5,4 +5,6 @@ module.exports = { images: { domains: ['https://github.com', 'https://githubusercontent.com/' ], }, + basePath: "/tiffanywang", + output: "export", } \ No newline at end of file