This guide is designed for beginners. You don’t need complex configurations to deploy your website.
Build your project
First, ensure you have the correct Node.js version installed.
Open your terminal in the project folder and run:
npm install
npm run build
This will create a folder named out in your project directory. This folder contains your generated website.
username.github.io (replace username with your actual GitHub username).Upload Files
out folder to your new repository.out folder.out to the repository.Add .nojekyll file
.nojekyll (start with a dot, all lowercase)._ (like _next).main) and click Save.https://username.github.io to see your website.PRISM also supports automatic deployment to GitHub Pages using GitHub Actions.
This method is recommended if you want your site to update automatically whenever you push changes.
This repository includes an optional workflow located at:
.github/workflows/deploy.yml
For template users, GitHub disables workflows by default.
To enable deployment:
(Optional) To enable automatic deployment on push:
Edit .github/workflows/deploy.yml and uncomment:
on:
push:
branches:
- main
- ci
Once enabled, GitHub Actions will:
npm install && npm run build)out/Your site will be available at https://<username>.github.io
If you are using a repository other than username.github.io, your site will be at https://<username>.github.io/<repository>/.
In this case, make sure to set the basePath and assetPrefix in next.config.ts accordingly to add path prefixes to your assets:
// next.config.ts
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: 'export',
trailingSlash: true,
// Add these two lines
basePath: "/my-repo",
assetPrefix: "/my-repo",
images: {
unoptimized: true,
},
/* config options here */
webpack: (config) => {
config.module.rules.push({
test: /\.bib$/,
type: 'asset/source',
});
return config;
},
};
export default nextConfig;
Build your project
Run npm run build to generate the out folder.
my-site).out folder (or a zip archive of it) into the upload area.https://<project-name>.pages.dev.