Skip to content
Merged
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
22 changes: 18 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy VitePress site to Pages

on:
push:
branches: [main, v1]
branches: [main, v2, v1]

workflow_dispatch:

Expand All @@ -26,6 +26,13 @@ jobs:
path: main
fetch-depth: 0

- name: Checkout v2
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: v2
path: v2
fetch-depth: 0

- name: Checkout v1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
Expand All @@ -43,12 +50,18 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d

- name: Build main docs (v2.0 — current)
- name: Build main docs (v3 — current)
working-directory: main
run: |
npm ci
npm run docs:build

- name: Build v2 docs (v2.x — maintenance)
working-directory: v2
run: |
npm ci
npm run docs:build

- name: Build v1 docs (v1.x — stable)
working-directory: v1
run: |
Expand All @@ -59,7 +72,8 @@ jobs:
run: |
mkdir -p site
cp -r main/docs/.vitepress/dist/. site/
mkdir -p site/v1
mkdir -p site/v2 site/v1
cp -r v2/docs/.vitepress/dist/. site/v2/
cp -r v1/docs/.vitepress/dist/. site/v1/

- name: Upload artifact
Expand All @@ -68,7 +82,7 @@ jobs:
path: site

deploy:
# Every branch pushed above (main, v1) must also be listed in Settings >
# Every branch pushed above (main, v2, v1) must also be listed in Settings >
# Environments > github-pages > Deployment branches, or this job 403s.
environment:
name: github-pages
Expand Down
9 changes: 5 additions & 4 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ const frameworks = [
export default defineConfig({
title: 'Simple Data Objects',
description: 'Lightweight, attribute-driven Data Transfer Objects for PHP 8.4+',
base: '/simple-data-objects/',
base: '/simple-data-objects/v2/',

head: [
['link', { rel: 'icon', type: 'image/png', href: '/simple-data-objects/favicon.png' }],
['link', { rel: 'icon', type: 'image/png', href: '/simple-data-objects/v2/favicon.png' }],
],

markdown: {
Expand Down Expand Up @@ -196,9 +196,10 @@ export default defineConfig({
{
text: 'v2',
items: [
{ text: 'v2 (current)', link: '/' },
{ text: 'v3 (current)', link: 'https://std-out.github.io/simple-data-objects/' },
{ text: 'v2 (maintenance)', link: '/' },
{ text: 'v1 (stable)', link: 'https://std-out.github.io/simple-data-objects/v1/' },
{ text: 'Changelog', link: 'https://github.com/std-out/simple-data-objects/blob/main/CHANGELOG.md' },
{ text: 'Changelog', link: 'https://github.com/std-out/simple-data-objects/blob/v2/CHANGELOG.md' },
],
},
],
Expand Down
Loading