-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
2,877 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Deploy Next.js to GitHub Pages | ||
|
||
# Trigger the workflow on pushes to the main branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
# Define the environment to run the job | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the code from the repository | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Node.js to build the Next.js app | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' # Use the latest supported Node.js version | ||
|
||
# Step 3: Install dependencies | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
# Step 4: Build and export the app | ||
- name: Build and export Next.js | ||
run: | | ||
npm run build | ||
npm run export | ||
# Step 5: Deploy the static files to GitHub Pages | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import type { NextConfig } from "next"; | ||
|
||
const nextConfig: NextConfig = { | ||
/* config options here */ | ||
const nextConfig = { | ||
output: 'export', // Enable static export | ||
assetPrefix: './', | ||
trailingSlash: true, | ||
}; | ||
|
||
export default nextConfig; | ||
module.exports = nextConfig; |
Oops, something went wrong.