From 7ffd7ed40a6be0bc7424938b828085a2f0796855 Mon Sep 17 00:00:00 2001 From: lukicenturi Date: Fri, 11 Oct 2024 18:55:16 +0700 Subject: [PATCH] chore: update CI to deploy bugfixes --- .github/workflows/deploy-docs.yml | 8 ++++++++ .vitepress/config.mts | 26 ++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) 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..4b906e9 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({ @@ -21,22 +23,22 @@ export default defineConfig({ { text: 'Home', link: '/' }, { text: 'Documentation', link: '/requirement-and-installation' }, { text: 'Download', link: 'https://rotki.com/download' }, - { + ...(isPatch ? [] : [{ text: isLatest ? 'Latest' : 'Stable', items: [ isLatest ? { - text: 'Stable', - link: 'https://docs.rotki.com/', - target: '_blank', - } + text: 'Stable', + link: 'https://docs.rotki.com/', + target: '_blank', + } : { - text: 'Latest', - link: 'https://docs.rotki.com/latest/', - target: '_blank', - }, + text: 'Latest', + link: 'https://docs.rotki.com/latest/', + target: '_blank', + }, ], - }, + }]), ], sidebar: [