Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ name: Deploy Docs
on:
push:
branches:
# make sure this is the branch you are using
- main
pull_request:
paths:
- '.github/workflows/deploy-ghpage.yml'

jobs:
deploy-gh-pages:
Expand All @@ -15,16 +17,13 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
# if your docs needs submodules, uncomment the following line
# submodules: true


- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: 7
run_install: true

version: 9.15.9
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -38,11 +37,13 @@ jobs:
- name: Build Docs
env:
NODE_OPTIONS: --max_old_space_size=8192
DEPLOY_PLATFORM: github
run: |-
pnpm run docs:build
> docs/.vuepress/dist/.nojekyll

- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 9 additions & 1 deletion docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ import theme from "./theme.js";

const __dirname = getDirname(import.meta.url);

const getBasePath = () => {
const platform = process.env.DEPLOY_PLATFORM;
if (platform === 'github') {
return '/docs/';
}
return '/';
};

export default defineUserConfig({
theme,
base: "/", // For Github Pages
base: getBasePath(),
head: [
[
"link",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ecosystem": "npx tsx scripts/ecosystem.ts",
"dev-build": "vuepress build docs",
"docs:build": "pnpm ecosystem && vuepress build docs",
"docs:build:github": "DEPLOY_PLATFORM=github pnpm ecosystem && vuepress build docs",
"docs:clean-dev": "vuepress dev docs --clean-cache",
"docs:dev": "vuepress dev docs",
"dev": "pnpm docs:dev"
Expand Down