Based on guide by Sangsoo Nam
Set up a branch named gh-pages
in the repository. This branch will be used to deploy the site.
git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Initial commit"
git checkout master
rm -rf dist
git worktree add dist gh-pages
Build site
pnpm build
To deploy to GitHub Pages, one can use the following command
cd dist
git add .
git commit -m "Deploy"
git push origin gh-pages
Optionally, remove worktree
git worktree remove dist