From 8b8ef07ecf037a6b97fb4465fa458951efea40b5 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Tue, 3 Oct 2023 17:56:24 -0500 Subject: [PATCH] Create parallel builds for the v2 site. When it is hosted in production, the website is at `effection/v2`, but when we're doing local development, the website is at `v2/`. Unfortunately, there is no way to control the docusaurus build at runtime, so this creates two builds, one that works at both paths. --- .github/workflows/v2-docs.yaml | 8 +++++--- website/docusaurus.config.local.js | 6 ++++++ website/docusaurus.config.prod.js | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 website/docusaurus.config.local.js create mode 100644 website/docusaurus.config.prod.js diff --git a/.github/workflows/v2-docs.yaml b/.github/workflows/v2-docs.yaml index 539924905..a7e381e58 100644 --- a/.github/workflows/v2-docs.yaml +++ b/.github/workflows/v2-docs.yaml @@ -22,9 +22,11 @@ jobs: - run: | cd website yarn install - yarn build - tar czvf ${{ github.ref_name }}.website.tgz -C public effection - cp *.website.tgz .. + yarn docusaurus build --config ./docusaurus.config.local.js --out-dir build/local + tar czvf ${{ github.ref_name }}.website.local.tgz -C build/local . + yarn docusaurus build --config ./docusaurus.config.prod.js --out-dir build/prod + tar czvf ${{ github.ref_name }}.website.prod.tgz -C build/prod . + cp *.tgz .. - run: node -pe '`relnum=${"${{ github.ref_name }}".substring("docs-v2-r".length)}`' >> $GITHUB_OUTPUT id: relnum diff --git a/website/docusaurus.config.local.js b/website/docusaurus.config.local.js new file mode 100644 index 000000000..93a11a5e0 --- /dev/null +++ b/website/docusaurus.config.local.js @@ -0,0 +1,6 @@ +const base = require('./docusaurus.config'); + +module.exports = { + ...base, + baseUrl: 'v2/', +} diff --git a/website/docusaurus.config.prod.js b/website/docusaurus.config.prod.js new file mode 100644 index 000000000..58c0629ab --- /dev/null +++ b/website/docusaurus.config.prod.js @@ -0,0 +1,6 @@ +const base = require('./docusaurus.config'); + +module.exports = { + ...base, + baseUrl: 'effection/v2/', +}