Skip to content

Commit 7adf3b3

Browse files
committed
Configure GitHub Pages deployment and update Nuxt settings for improved documentation generation
1 parent 841d941 commit 7adf3b3

File tree

3 files changed

+97
-16
lines changed

3 files changed

+97
-16
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["2.x"]
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/deploy-docs.yml'
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v5
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '20'
41+
cache: 'npm'
42+
cache-dependency-path: 'docs/package.json'
43+
44+
- name: Install dependencies
45+
working-directory: ./docs
46+
run: npm ci
47+
48+
- name: Build documentation
49+
working-directory: ./docs
50+
run: npm run generate
51+
env:
52+
NUXT_APP_BASE_URL: /flowforge/
53+
54+
- name: Add .nojekyll file
55+
working-directory: ./docs
56+
run: touch .output/public/.nojekyll
57+
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v3
60+
with:
61+
path: ./docs/.output/public
62+
63+
# Deployment job
64+
deploy:
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
runs-on: ubuntu-latest
69+
needs: build
70+
steps:
71+
- name: Deploy to GitHub Pages
72+
id: deployment
73+
uses: actions/deploy-pages@v4

docs/nuxt.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ export default defineNuxtConfig({
33
extends: 'docus',
44
modules: ["@nuxt/image", "@nuxt/scripts"],
55
devtools: {enabled: true},
6+
app: {
7+
baseURL: process.env.NODE_ENV === 'production' ? '/flowforge/' : '/'
8+
},
69
content: {
710
build: {
811
markdown: {
@@ -13,5 +16,8 @@ export default defineNuxtConfig({
1316
}
1417
}
1518
}
19+
},
20+
nitro: {
21+
preset: 'github_pages'
1622
}
17-
})
23+
})

docs/package.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
2-
"name": "flowforge-docs",
3-
"scripts": {
4-
"dev": "nuxt dev --extends docus",
5-
"build": "nuxt build --extends docus"
6-
},
7-
"dependencies": {
8-
"@nuxt/image": "^1.11.0",
9-
"@nuxt/scripts": "^0.11.13",
10-
"@nuxt/ui": "^3.3.3",
11-
"@unhead/vue": "^2.0.14",
12-
"better-sqlite3": "^12.2.0",
13-
"docus": "latest",
14-
"nuxt": "^4.1.0",
15-
"typescript": "^5.9.2"
16-
}
2+
"name": "flowforge-docs",
3+
"scripts": {
4+
"dev": "nuxt dev --extends docus",
5+
"build": "nuxt build --extends docus",
6+
"generate": "nuxt build --preset github_pages",
7+
"preview": "nuxt preview"
8+
},
9+
"dependencies": {
10+
"@nuxt/image": "^1.11.0",
11+
"@nuxt/scripts": "^0.11.13",
12+
"@nuxt/ui": "^3.3.3",
13+
"@unhead/vue": "^2.0.14",
14+
"better-sqlite3": "^12.2.0",
15+
"docus": "latest",
16+
"nuxt": "^4.1.0",
17+
"typescript": "^5.9.2"
18+
}
1719
}

0 commit comments

Comments
 (0)