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 = {
9
9
hostname : '**' , // Adjust this for production
10
10
} ,
11
11
] ,
12
+ unoptimized : true , // Required for static export with GitHub Pages
12
13
} ,
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' : '' ,
14
19
15
20
// Disable typescript checking temporarily
16
21
typescript : {
@@ -26,6 +31,9 @@ const nextConfig = {
26
31
config . resolve . fallback = { fs : false } ;
27
32
return config ;
28
33
} ,
34
+
35
+ // Configure trailing slash for better compatibility with GitHub Pages
36
+ trailingSlash : true ,
29
37
} ;
30
38
31
39
module . 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