Skip to content

Commit

Permalink
👷 fix the GITHUB_PAGES check
Browse files Browse the repository at this point in the history
  • Loading branch information
drieshooghe committed Sep 27, 2024
1 parent 0d76c65 commit 39e315c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/cd-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ jobs:
cache-key: docs
node-version: 22.x

- name: Setup GH Pages
uses: actions/configure-pages@v4
with:
static_site_generator: next

- name: Build
run: pnpm build --filter='./docs/**'
env:
GITHUB_PAGES: true

- name: Upload build
uses: actions/upload-pages-artifact@v3
Expand Down
5 changes: 4 additions & 1 deletion docs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const forGithubPages = process.env.GITHUB_PAGES === 'true' || false
const forGithubPages = process.env.GITHUB_PAGES === 'true';
console.log(`Building for Github Pages: ${forGithubPages}`);

let assetPrefix = '';
let basePath = '';
Expand All @@ -7,6 +8,8 @@ if (forGithubPages) {
const repo = 'event-sourcing';
assetPrefix = `/${repo}/`;
basePath = `/${repo}`;
console.log(`Setting the asset prefix to: ${assetPrefix}`);
console.log(`Setting the base path to: ${basePath}`);
}
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
Expand Down
3 changes: 2 additions & 1 deletion docs/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"extends": ["//"],
"tasks": {
"build": {
"outputs": ["dist/**"]
"outputs": ["dist/**"],
"env": ["GITHUB_PAGES"]
},
"lint": {},
"format": {}
Expand Down

0 comments on commit 39e315c

Please sign in to comment.