From 56b4fb2c71c28623c42b61a10aa3411532230fd4 Mon Sep 17 00:00:00 2001 From: MAVRICK-1 Date: Fri, 22 Nov 2024 03:16:47 +0530 Subject: [PATCH] ci: Update GitHub Actions workflow for Next.js deployment and configure basePath --- .github/workflows/nextjs.yml | 12 +----------- next.config.js | 5 ++++- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml index e04acaa..559b5f3 100644 --- a/.github/workflows/nextjs.yml +++ b/.github/workflows/nextjs.yml @@ -3,26 +3,21 @@ name: Deploy Next.js site to Pages on: - # Trigger on pushes to the dev branch push: branches: ["dev"] - # Allow manual triggers from the Actions tab workflow_dispatch: -# Permissions for deployment permissions: contents: read pages: write id-token: write -# Concurrency settings concurrency: group: "pages" cancel-in-progress: false jobs: - # Build job build: runs-on: ubuntu-latest steps: @@ -56,19 +51,14 @@ jobs: - name: Install dependencies run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} - - name: Configure for GitHub Pages - run: | - echo "module.exports = { basePath: '/' };" > next.config.js - - name: Build and export the site - run: ${{ steps.detect-package-manager.outputs.runner }} next build && ${{ steps.detect-package-manager.outputs.runner }} next export + run: ${{ steps.detect-package-manager.outputs.runner }} next build - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: ./out - # Deployment job deploy: environment: name: github-pages diff --git a/next.config.js b/next.config.js index 767719f..8ef8a09 100644 --- a/next.config.js +++ b/next.config.js @@ -1,4 +1,7 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {} +const nextConfig = { + output: 'export', + basePath: '/new-website', +} module.exports = nextConfig