Skip to content

Commit cde69f3

Browse files
authored
Update docs build to create multi-version builds. (#37)
* Update docs build to create multi-version builds. * Build all doc versions from 1.0.0.
1 parent 3d92302 commit cde69f3

File tree

9 files changed

+1280
-488
lines changed

9 files changed

+1280
-488
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-memcached-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
- '18'
2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
- name: Install node ${{ matrix.node-version }}
27-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
2828
with:
2929
node-version: ${{ matrix.node-version }}
3030
registry-url: https://registry.npmjs.org

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
steps:
1919
# Install deps and cache
2020
- name: Checkout code
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222
- name: Install node ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626
cache: npm

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: '/memcached/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/memcached/*"
4653
to = "/:splat"
47-
status = 200
54+
status = 200

0 commit comments

Comments
 (0)