Skip to Content
Deployment

Deployment

Deploy your documentation site to GitHub Pages or any static hosting provider.

GitHub Pages

Manual Deployment

  1. Update next.config.mjs

Replace your-repo-name with your actual repository name:

...(isGithubActions && { basePath: '/your-actual-repo-name', assetPrefix: '/your-actual-repo-name/' })
  1. Build the site
npm run build
  1. Deploy using gh-pages
npx gh-pages -d out

Or push the out/ directory to your gh-pages branch manually.

Automatic Deployment (Optional)

You can set up GitHub Actions for automatic deployment:

  1. 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
  1. Enable GitHub Pages in repository Settings → Pages → Set source to “GitHub Actions”

Other Platforms

Vercel

Deploy to Vercel with one click:

  1. Import your repository to Vercel
  2. Vercel will auto-detect Next.js
  3. Deploy!

Note: Remove the basePath and assetPrefix from next.config.mjs for Vercel deployment.

Netlify

  1. Connect your repository to Netlify
  2. Set build command: npm run build
  3. Set publish directory: out
  4. Deploy!

Manual Deployment

Build the static site:

npm run build

The 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:

  1. Add a CNAME file to the public/ folder with your domain
  2. Configure your domain’s DNS settings
  3. Enable HTTPS in repository settings

See GitHub’s custom domain documentation  for details.

Last updated on