Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 18 additions & 0 deletions .github/workflows/deploy-docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,27 @@ jobs:
working-directory: docs
cache-dependency-path: docs/pnpm-lock.yaml

- name: Restore docs Vite Task cache
id: vite-task-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: docs/node_modules/.vite/task-cache
key: vite-task-docs-${{ runner.os }}-${{ runner.arch }}-pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
# Prefer this PR's newest cache, then fall back to main for new PRs.
restore-keys: |
vite-task-docs-${{ runner.os }}-${{ runner.arch }}-pr-${{ github.event.pull_request.number }}-
vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main-

- run: vp run build
working-directory: docs

- name: Save docs Vite Task cache
if: success() && steps.vite-task-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: docs/node_modules/.vite/task-cache
key: ${{ steps.vite-task-cache.outputs.cache-primary-key }}

- run: vpx void deploy --dir docs/.vitepress/dist
env:
VOID_TOKEN: ${{ secrets.VOID_TOKEN }}
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,26 @@ jobs:
working-directory: docs
cache-dependency-path: docs/pnpm-lock.yaml

- name: Restore docs Vite Task cache
id: vite-task-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: docs/node_modules/.vite/task-cache
key: vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main-${{ github.sha }}
# Restore the latest main cache; Vite Task fingerprints decide reuse.
restore-keys: |
vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main-

- run: vp run build
working-directory: docs

- name: Save docs Vite Task cache
if: success() && steps.vite-task-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: docs/node_modules/.vite/task-cache
key: ${{ steps.vite-task-cache.outputs.cache-primary-key }}

- run: vpx void deploy --dir docs/.vitepress/dist
env:
VOID_TOKEN: ${{ secrets.VOID_TOKEN }}
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"type": "module",
"scripts": {
"dev": "vitepress dev",
"build": "cp ../packages/cli/install.sh ../packages/cli/install.ps1 public/ && vitepress build",
"build": "cp ../packages/cli/install.sh ../packages/cli/install.ps1 public/ && vp run build:site",
"build:netlify": "cp ../packages/cli/install.sh ../packages/cli/install.ps1 public/ && vitepress build",
"preview": "vitepress preview",
"update-trusted-stack-stats": "node .vitepress/theme/data/fetch-trusted-stack-stats.ts"
},
Expand Down
17 changes: 17 additions & 0 deletions docs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default {
run: {
tasks: {
'build:site': {
command: 'vitepress build',
input: [
{ auto: true },
'!.vitepress/.temp/**',
'!.vitepress/dist/**',
'!node_modules',
Comment thread
wan9chi marked this conversation as resolved.
'!node_modules/.vite-temp/**',
],
output: ['.vitepress/dist/**'],
},
},
},
};
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build]
base = "docs/"
command = "pnpm build"
command = "pnpm build:netlify"
publish = ".vitepress/dist"

# Windows installer redirect
Expand Down
Loading