Skip to content

Commit

Permalink
Update docs build to create multi-version builds. (#74)
Browse files Browse the repository at this point in the history
* Update docs build to create multi-version builds.

* Build all doc versions from 1.0.0.
  • Loading branch information
reynoldsalec authored Oct 9, 2024
1 parent cba18c6 commit 050589a
Show file tree
Hide file tree
Showing 10 changed files with 1,245 additions and 503 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/pr-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
jobs:
docs-tests:
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
os:
Expand All @@ -17,9 +15,15 @@ jobs:
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache version builds
uses: actions/cache@v4
with:
key: lando-mvb-docs
path: docs/.vitepress/cache/@lando/mvb
save-always: true
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand All @@ -29,5 +33,7 @@ jobs:
# Run tests
- name: Run linter
run: npm run lint
- name: Test mvb
run: npm run docs:mvb
- name: Test build
run: npm run docs:build
4 changes: 2 additions & 2 deletions .github/workflows/pr-laravel-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export default defineConfig({
['link', {rel: 'icon', href: '/laravel/favicon.svg', type: 'image/svg+xml'}],
],
themeConfig: {
multiVersionBuild: {
satisfies: '>=1.0.0',
},
sidebar: sidebar(),
},
});
Expand Down
40 changes: 40 additions & 0 deletions docs/v/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
description: All Other documentation versions
title: Docuverse
contributors: false
lastUpdated: false
editLink: false
next: false
prev: false
---
# Docuverse

<br />
<br />

<div
v-for="link in links"
:key="link.text"
class="version-link"
>
<VPLVersionLink
:text="link.text"
:href="link.href"
:prerelease="link.prerelease"
:stable="link.stable"
:edge="link.edge"
/>
</div>

<br />

<div>
<VPLVersionLink :dev="true" :text="aliases.dev" :href="aliasLinks.dev" />
</div>

<script setup>
import {useTags} from '@lando/vitepress-theme-default-plus';
import {VPLCollectionPage, VPLCollectionPageSection, VPLCollectionPageTitle, VPLVersionLink} from '@lando/vitepress-theme-default-plus';

const {aliases, aliasLinks, links} = useTags();
</script>
23 changes: 15 additions & 8 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
[build]
base = "./"
publish = "docs/.vitepress/dist"
command = "npm run docs:mvb"

[context.deploy-preview]
command = "npm run docs:build"

# https://github.com/munter/netlify-plugin-checklinks#readme
[[context.deploy-preview.plugins]]
package = "netlify-plugin-checklinks"
[context.deploy-preview.plugins.inputs]
todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/" ]
skipPatterns = [ ".rss", ".gif", ".jpg" ]
checkExternal = true



# Sets our asset optimization
[build.processing.css]
bundle = true
Expand All @@ -28,13 +41,7 @@
[plugins.inputs.audits]
output_path = "reports/lighthouse.html"

# https://github.com/munter/netlify-plugin-checklinks#readme
[[plugins]]
package = "netlify-plugin-checklinks"
[plugins.inputs]
todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com" ]
skipPatterns = [ ".rss", ".gif", ".jpg" ]
checkExternal = true


# We need this so preview environments and the base site look ok on their own
[[redirects]]
Expand All @@ -44,4 +51,4 @@
[[redirects]]
from = "/plugins/laravel/*"
to = "/:splat"
status = 200
status = 200
Loading

0 comments on commit 050589a

Please sign in to comment.