diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 67ee758..21facab 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -5,6 +5,7 @@ on: branches: - main - develop + - bugfixes concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -46,6 +47,13 @@ jobs: env: DOCS_VERSION: latest + - name: Build bugfixes (patch) docs + run: | + git checkout bugfixes + pnpm run build --outDir .vitepress/dist/patch + env: + DOCS_VERSION: patch + - name: Combine builds run: | mv .vitepress/dist-main/* .vitepress/dist/ diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 81f47bd..3de7e3e 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -6,8 +6,10 @@ import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'; const __dirname = path.dirname(fileURLToPath(new URL(import.meta.url))); -const isLatest = process.env.DOCS_VERSION === 'latest'; -const base = isLatest ? '/latest' : '/'; +const DOCS_VERSION = process.env.DOCS_VERSION; +const isLatest = DOCS_VERSION === 'latest'; +const isPatch = DOCS_VERSION === 'patch'; +const base = isLatest || isPatch ? `/${DOCS_VERSION}` : '/'; // https://vitepress.dev/reference/site-config export default defineConfig({ @@ -131,5 +133,6 @@ export default defineConfig({ srcExclude: ['**/README.md', '**/LICENSE.md'], rewrites: { 'latest/:path*': ':path*', + 'patch/:path*': ':path*', }, });