Skip to content

Commit 4d771ac

Browse files
authored
Update docs build to create multi-version builds. (#44)
* Update docs build to create multi-version builds. * Build all doc versions from 1.0.0.
1 parent 5a3a0fd commit 4d771ac

10 files changed

+1282
-490
lines changed

.github/workflows/pr-docs-tests.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,25 @@ jobs:
1515
steps:
1616
# Install deps and cache
1717
- name: Checkout code
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
19+
- name: Cache version builds
20+
uses: actions/cache@v4
21+
with:
22+
key: lando-mvb-docs
23+
path: docs/.vitepress/cache/@lando/mvb
24+
save-always: true
1925
- name: Install node ${{ matrix.node-version }}
20-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2127
with:
2228
node-version: ${{ matrix.node-version }}
2329
cache: npm
24-
- name: Install dependencies
30+
- name: Install NPM dependencies
2531
run: npm clean-install --prefer-offline --frozen-lockfile
2632

2733
# Run tests
2834
- name: Run linter
2935
run: npm run lint
36+
- name: Test mvb
37+
run: npm run docs:mvb
3038
- name: Test build
3139
run: npm run docs:build

.github/workflows/pr-linter.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
steps:
1616
# Install deps and cache
1717
- name: Checkout code
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
- name: Install node ${{ matrix.node-version }}
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: ${{ matrix.node-version }}
2323
cache: npm

.github/workflows/pr-postgres-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
steps:
3131

3232
- name: Checkout code
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
- name: Install node ${{ matrix.node-version }}
35-
uses: actions/setup-node@v3
35+
uses: actions/setup-node@v4
3636
with:
3737
node-version: ${{ matrix.node-version }}
3838
registry-url: https://registry.npmjs.org

.github/workflows/pr-unit-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
steps:
1818
# Install deps and cache
1919
- name: Checkout code
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
- name: Install node ${{ matrix.node-version }}
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2323
with:
2424
node-version: ${{ matrix.node-version }}
2525
cache: npm

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
steps:
2222
# Install deps and cache
2323
- name: Checkout code
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
- name: Install node ${{ matrix.node-version }}
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2727
with:
2828
node-version: ${{ matrix.node-version }}
2929
registry-url: https://registry.npmjs.org

docs/.vitepress/config.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export default defineConfig({
1919
['link', {rel: 'icon', href: '/postgres/favicon.svg', type: 'image/svg+xml'}],
2020
],
2121
themeConfig: {
22+
multiVersionBuild: {
23+
satisfies: '>=1.0.0',
24+
},
2225
sidebar: sidebar(),
2326
},
2427
});

docs/v/index.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
description: All Other documentation versions
3+
title: Docuverse
4+
contributors: false
5+
lastUpdated: false
6+
editLink: false
7+
next: false
8+
prev: false
9+
---
10+
# Docuverse
11+
12+
<br />
13+
<br />
14+
15+
<div
16+
v-for="link in links"
17+
:key="link.text"
18+
class="version-link"
19+
>
20+
<VPLVersionLink
21+
:text="link.text"
22+
:href="link.href"
23+
:prerelease="link.prerelease"
24+
:stable="link.stable"
25+
:edge="link.edge"
26+
/>
27+
</div>
28+
29+
<br />
30+
31+
<div>
32+
<VPLVersionLink :dev="true" :text="aliases.dev" :href="aliasLinks.dev" />
33+
</div>
34+
35+
<script setup>
36+
import {useTags} from '@lando/vitepress-theme-default-plus';
37+
import {VPLCollectionPage, VPLCollectionPageSection, VPLCollectionPageTitle, VPLVersionLink} from '@lando/vitepress-theme-default-plus';
38+
39+
const {aliases, aliasLinks, links} = useTags();
40+
</script>

netlify.toml

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
[build]
22
base = "./"
33
publish = "docs/.vitepress/dist"
4+
command = "npm run docs:mvb"
5+
6+
[context.deploy-preview]
47
command = "npm run docs:build"
58

9+
# https://github.com/munter/netlify-plugin-checklinks#readme
10+
[[context.deploy-preview.plugins]]
11+
package = "netlify-plugin-checklinks"
12+
[context.deploy-preview.plugins.inputs]
13+
todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/" ]
14+
skipPatterns = [ ".rss", ".gif", ".jpg" ]
15+
checkExternal = true
16+
17+
18+
619
# Sets our asset optimization
720
[build.processing.css]
821
bundle = true
@@ -28,13 +41,7 @@
2841
[plugins.inputs.audits]
2942
output_path = "reports/lighthouse.html"
3043

31-
# https://github.com/munter/netlify-plugin-checklinks#readme
32-
[[plugins]]
33-
package = "netlify-plugin-checklinks"
34-
[plugins.inputs]
35-
todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com" ]
36-
skipPatterns = [ ".rss", ".gif", ".jpg" ]
37-
checkExternal = true
44+
3845

3946
# We need this so preview environments and the base site look ok on their own
4047
[[redirects]]
@@ -44,4 +51,4 @@
4451
[[redirects]]
4552
from = "/plugins/postgres/*"
4653
to = "/:splat"
47-
status = 200
54+
status = 200

0 commit comments

Comments
 (0)