Skip to content

Commit f4a4a7f

Browse files
authored
Merge pull request #4 from as-ascii/configure-production-deployment
Configure production deployment
2 parents 363ce8e + 5c9b28a commit f4a4a7f

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ jobs:
3131
run: npm install
3232

3333
- name: Build website
34-
run: npm run build:debug
34+
run: |
35+
if [[ "$CURRENT_BRANCH" == *"--debug" ]]; then
36+
npm run build:debug
37+
else
38+
npm run build
39+
fi
3540
env:
3641
CURRENT_BRANCH: ${{ github.ref_name }}
3742

docusaurus.config.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,24 @@ const [organizationName, projectName] = parts.length === 2
1313

1414
const currentBranch = process.env.CURRENT_BRANCH || 'master';
1515

16+
// Production settings for the main repository
17+
const isProd = githubRepository === 'docwire/docwire.io';
18+
const prodUrl = 'https://docwire.io';
19+
const prodBaseUrl = '/';
20+
21+
// Fallback settings for forks and local development
22+
const devUrl = `https://${organizationName}.github.io`;
23+
const devBaseUrl = `/${projectName}/`;
24+
1625
/** @type {import('@docusaurus/types').Config} */
1726
const config = {
1827
title: 'Docwire',
1928
tagline: 'Award-winning modern data processing in C++20',
2029
favicon: 'img/FaviconLogo.png',
2130

22-
// Set the production url of your site here
23-
url: `https://${organizationName}.github.io`,
24-
// Set the /<baseUrl>/ pathname under which your site is served
25-
// For GitHub pages deployment, it is often '/<projectName>/'
26-
baseUrl: `/${projectName}/`,
31+
// Set the URL and base URL depending on the environment
32+
url: isProd ? prodUrl : devUrl,
33+
baseUrl: isProd ? prodBaseUrl : devBaseUrl,
2734

2835
// GitHub pages deployment config.
2936
organizationName, // Your GitHub username

0 commit comments

Comments
 (0)