Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build for develop #22

Closed
wants to merge 1 commit into from
Closed
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
26 changes: 23 additions & 3 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
push:
branches:
- main
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -15,6 +16,8 @@ jobs:
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches

- name: Setup pnpm
uses: pnpm/action-setup@v4
Expand All @@ -28,8 +31,25 @@ jobs:
- name: Install dependencies 👨🏻‍💻
run: pnpm install --frozen-lockfile

- name: Build static
run: pnpm run build
- name: Build main (default) docs
run: |
git checkout main
pnpm run build
mv .vitepress/dist .vitepress/dist-main
env:
DOCS_VERSION: stable

- name: Build develop (latest) docs
run: |
git checkout develop
pnpm run build --outDir .vitepress/dist/latest
env:
DOCS_VERSION: latest

- name: Combine builds
run: |
mv .vitepress/dist-main/* .vitepress/dist/
rm -rf .vitepress/dist-main
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
Expand Down
24 changes: 24 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import path from 'node:path';
import process from 'node:process';
import { URL, fileURLToPath } from 'node:url';
import { defineConfig } from 'vitepress';
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' : '/';

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Rotki Documentation',
base,
description: 'All you need to start using rotki, or contributing to it.',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
Expand All @@ -16,6 +21,22 @@
{ text: 'Home', link: '/' },
{ text: 'Documentation', link: '/requirement-and-installation' },
{ text: 'Download', link: 'https://rotki.com/download' },
{
text: isLatest ? 'Latest' : 'Stable',
items: [
isLatest
? {
text: 'Stable',

Check failure on line 29 in .vitepress/config.mts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 16 spaces but found 14
link: 'https://lukicenturi.github.io/rotki-docs/',

Check failure on line 30 in .vitepress/config.mts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 16 spaces but found 14
target: '_blank',

Check failure on line 31 in .vitepress/config.mts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 16 spaces but found 14
}

Check failure on line 32 in .vitepress/config.mts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 14 spaces but found 12
: {
text: 'Latest',

Check failure on line 34 in .vitepress/config.mts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 16 spaces but found 14
link: 'https://lukicenturi.github.io/rotki-docs/latest/',

Check failure on line 35 in .vitepress/config.mts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 16 spaces but found 14
target: '_blank',

Check failure on line 36 in .vitepress/config.mts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 16 spaces but found 14
},

Check failure on line 37 in .vitepress/config.mts

View workflow job for this annotation

GitHub Actions / ci

Expected indentation of 14 spaces but found 12
],
},
],

sidebar: [
Expand Down Expand Up @@ -108,4 +129,7 @@
},
},
srcExclude: ['**/README.md', '**/LICENSE.md'],
rewrites: {
'latest/:path*': ':path*',
},
});
Loading