Skip to content

docs: make v2 the default docs, move v1 to /v1/ subpath #45

docs: make v2 the default docs, move v1 to /v1/ subpath

docs: make v2 the default docs, move v1 to /v1/ subpath #45

Workflow file for this run

name: Deploy VitePress site to Pages
on:
push:
branches: [main, v1]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v7
with:
ref: main
path: main
fetch-depth: 0
- name: Checkout v1
uses: actions/checkout@v7
with:
ref: v1
path: v1
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
cache-dependency-path: main/package-lock.json
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Build main docs (v2.0 — current)
working-directory: main
run: |
npm ci
npm run docs:build
- name: Build v1 docs (v1.x — stable)
working-directory: v1
run: |
npm ci
npm run docs:build
- name: Assemble combined site
run: |
mkdir -p site
cp -r main/docs/.vitepress/dist/. site/
mkdir -p site/v1
cp -r v1/docs/.vitepress/dist/. site/v1/
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: site
deploy:
# Every branch pushed above (main, v1) must also be listed in Settings >
# Environments > github-pages > Deployment branches, or this job 403s.
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5