Skip to main content

Deployment

This article outlines deployment configuration of this website.

Get started

To ensure smooth deployment, let's build the static files for production. Run either of the following:

npm run build
npm run build && npm run serve
npm run build && npm run serve -- --build --port 80 --host 0.0.0.0

CLI

Using the docusaurus build command is a convenient way to build the website and push to the gh-pages branch. Note that the following configuration is REQUIRED.

docusaurus.config.ts
const config: Config =  {
// ...
url: 'https://your-website-url.com',
baseUrl: '/',
projectName: 'you-project-name.github.io',
organizationName: 'your-organization-name',
deploymentBranch: 'gh-pages',
trailingSlash: false,
// ...
};
GIT_USER=<GITHUB_USERNAME> yarn deploy

SSH Deployment

USE_SSH=true yarn deploy

GitHub Actions

.github/workflows/deploy.yml
name: Deploy to GitHub Pages

on:
push:
branches:
- main


permissions:
contents: write

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: |
cd website
npm install
npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: website/build
cname: yourapp.pages.dev # Optional: For Cloudflare deployment