File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy Documentation Preview
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ comment :
7+ description : ' Deployment Documentation'
8+ required : false
9+ default : ' Manual preview deployment'
10+
11+ jobs :
12+ build-and-deploy :
13+ if : github.ref_name == 'main' || github.event_name == 'workflow_dispatch'
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ deployments : write
18+
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v4
22+
23+ - name : Setup Node.js
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : 20
27+ cache : npm
28+
29+ - name : Install dependencies
30+ run : |
31+ npm install
32+
33+ - name : Build frontend
34+ run : npm run build
35+
36+ - name : Deploy to Cloudflare Pages
37+ uses : cloudflare/wrangler-action@v3
38+ with :
39+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
40+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41+ command : pages deploy out --project-name=deploystack-docs --branch=main
42+ gitHubToken : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Deploy Documentation Production
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ comment :
7+ description : ' Deployment Documentation'
8+ required : false
9+ default : ' Manual Production deployment'
10+
11+ jobs :
12+ build-and-deploy :
13+ if : github.ref_name == 'prod' || github.event_name == 'workflow_dispatch'
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ deployments : write
18+
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v4
22+
23+ - name : Setup Node.js
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : 20
27+ cache : npm
28+
29+ - name : Install dependencies
30+ run : |
31+ npm install
32+
33+ - name : Build frontend
34+ run : npm run build
35+
36+ - name : Deploy to Cloudflare Pages
37+ uses : cloudflare/wrangler-action@v3
38+ with :
39+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
40+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41+ command : pages deploy out --project-name=deploystack-docs --branch=prod
42+ gitHubToken : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -71,4 +71,5 @@ coverage/
7171.jest /
7272
7373._ * .mdx
74- ._ * .ts
74+ ._ * .ts
75+ out /
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { source } from '@/lib/source' ;
22import { getCanonicalUrl } from '@/lib/seo-utils' ;
33
4+ export const dynamic = 'force-static' ;
5+ export const revalidate = false ;
6+
47export async function GET ( ) {
58 const pages = source . getPages ( ) ;
69
Original file line number Diff line number Diff line change @@ -5,12 +5,15 @@ const withMDX = createMDX();
55/** @type {import('next').NextConfig } */
66const config = {
77 reactStrictMode : true ,
8+ output : 'export' , // Enable static HTML export
9+ trailingSlash : true , // Required for static export
10+ basePath : '/docs' , // Set base path for the application
11+ assetPrefix : '/docs' , // Ensure assets are also prefixed with /docs
12+ images : {
13+ unoptimized : true // Required for static export
14+ } ,
815 // Sitemap is now handled by app/docs/sitemap.xml/route.ts
916 // If you have other Next.js configurations, add them here
10- // For example, if you need to serve static files from the 'public' directory
11- // and your images are in 'docs/assets/images', you might need to configure images domain
12- // or ensure they are moved to 'public/docs/assets/images' and referenced accordingly.
13- // For now, we'll stick to the basic config.
1417} ;
1518
1619export default withMDX ( config ) ;
Original file line number Diff line number Diff line change 55 "private" : true ,
66 "scripts" : {
77 "dev" : " next dev" ,
8- "build" : " next build" ,
8+ "build" : " next build && npm run move-assets" ,
9+ "move-assets" : " mkdir -p out/docs/_next && cp -r out/_next/* out/docs/_next/ && rm -rf out/_next" ,
910 "start" : " next start" ,
1011 "lint:md" : " npx markdownlint-cli2 '**/*.md' '#node_modules' '#.github'" ,
1112 "lint:links" : " node check-links.js" ,
You can’t perform that action at this time.
0 commit comments