Deployment
Deploy your documentation site to GitHub Pages or any static hosting provider.
GitHub Pages
Manual Deployment
- Update
next.config.mjs
Replace your-repo-name with your actual repository name:
...(isGithubActions && {
basePath: '/your-actual-repo-name',
assetPrefix: '/your-actual-repo-name/'
})- Build the site
npm run build- Deploy using gh-pages
npx gh-pages -d outOr push the out/ directory to your gh-pages branch manually.
Automatic Deployment (Optional)
You can set up GitHub Actions for automatic deployment:
- Create
.github/workflows/deploy.yml:
name: Deploy to GitHub Pages
on:
push:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
env:
GITHUB_ACTIONS: true
- uses: actions/upload-pages-artifact@v3
with:
path: ./out
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- id: deployment
uses: actions/deploy-pages@v4- Enable GitHub Pages in repository Settings → Pages → Set source to “GitHub Actions”
Other Platforms
Vercel
Deploy to Vercel with one click:
- Import your repository to Vercel
- Vercel will auto-detect Next.js
- Deploy!
Note: Remove the basePath and assetPrefix from next.config.mjs for Vercel deployment.
Netlify
- Connect your repository to Netlify
- Set build command:
npm run build - Set publish directory:
out - Deploy!
Manual Deployment
Build the static site:
npm run buildThe output will be in the out/ directory. Upload this to any static hosting provider.
Search Configuration
After deployment, the search functionality will automatically work thanks to Pagefind, which generates the search index during the build process.
Custom Domain
To use a custom domain with GitHub Pages:
- Add a
CNAMEfile to thepublic/folder with your domain - Configure your domain’s DNS settings
- Enable HTTPS in repository settings
See GitHub’s custom domain documentation for details.
Last updated on