File tree Expand file tree Collapse file tree 3 files changed +66
-1
lines changed Expand file tree Collapse file tree 3 files changed +66
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to GitHub Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - main # Set a branch to deploy from
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : read
11+ pages : write
12+ id-token : write
13+
14+ concurrency :
15+ group : " pages"
16+ cancel-in-progress : false
17+
18+ jobs :
19+ # Build job
20+ build :
21+ runs-on : ubuntu-latest
22+ steps :
23+ - name : Checkout
24+ uses : actions/checkout@v3
25+
26+ - name : Setup Node
27+ uses : actions/setup-node@v3
28+ with :
29+ node-version : ' 18'
30+ cache : ' npm'
31+
32+ - name : Setup Pages
33+ uses : actions/configure-pages@v3
34+
35+ - name : Install dependencies
36+ run : npm ci
37+
38+ - name : Build with Next.js
39+ run : npm run build
40+
41+ - name : Upload artifact
42+ uses : actions/upload-pages-artifact@v1
43+ with :
44+ path : ./out
45+
46+ # Deployment job
47+ deploy :
48+ environment :
49+ name : github-pages
50+ url : ${{ steps.deployment.outputs.page_url }}
51+ runs-on : ubuntu-latest
52+ needs : build
53+ steps :
54+ - name : Deploy to GitHub Pages
55+ id : deployment
56+ uses : actions/deploy-pages@v2
Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ const nextConfig = {
99 hostname : '**' , // Adjust this for production
1010 } ,
1111 ] ,
12+ unoptimized : true , // Required for static export with GitHub Pages
1213 } ,
13- output : 'standalone' ,
14+ output : 'export' , // Changed from 'standalone' to 'export' for static site generation
15+
16+ // Base path for GitHub Pages
17+ basePath : '' ,
18+ assetPrefix : process . env . NODE_ENV === 'production' ? 'https://golangmastery.github.io' : '' ,
1419
1520 // Disable typescript checking temporarily
1621 typescript : {
@@ -26,6 +31,9 @@ const nextConfig = {
2631 config . resolve . fallback = { fs : false } ;
2732 return config ;
2833 } ,
34+
35+ // Configure trailing slash for better compatibility with GitHub Pages
36+ trailingSlash : true ,
2937} ;
3038
3139module . exports = nextConfig ;
Original file line number Diff line number Diff line change 1+ golangmastery.github.io
You can’t perform that action at this time.
0 commit comments