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 Next.js to GitHub Pages
1+ name : Deploy to GitHub Pages
22
33on :
44 push :
55 branches :
66 - main
77
8+ permissions :
9+ contents : write
10+
811jobs :
9- build-and- deploy :
12+ deploy :
1013 runs-on : ubuntu-latest
14+
1115 steps :
12- - name : Checkout repository
16+ - name : Checkout Repository
1317 uses : actions/checkout@v4
1418
15- - name : Install pnpm
16- uses : pnpm/action-setup@v4
17- with :
18- version : 9
19-
2019 - name : Setup Node.js
2120 uses : actions/setup-node@v4
2221 with :
23- node-version : ' 20'
22+ node-version : 18
23+ cache : yarn
24+
25+ - name : Install Dependencies
26+ run : yarn install
2427
25- - name : Install dependencies
26- run : pnpm install
28+ - name : Build Project
29+ run : yarn build
2730
28- - name : Build and export Next.js app
29- run : pnpm run build
31+ - name : Add .nojekyll
32+ run : touch out/.nojekyll
3033
3134 - name : Deploy to GitHub Pages
32- uses : peaceiris/actions-gh- pages@v4
35+ uses : JamesIves/github- pages-deploy-action @v4
3336 with :
34- github_token : ${{ secrets.GITHUB_TOKEN }}
35- publish_dir : ./out
36- publish_branch : gh-pages
37- force_orphan : true
37+ branch : gh-pages
38+ folder : out
Original file line number Diff line number Diff line change 11import type { NextConfig } from 'next' ;
22
3+ const isProd = process . env . NODE_ENV === 'production' ;
4+
5+ import type { NextConfig } from 'next' ;
6+
37const nextConfig : NextConfig = {
4- output : 'export' ,
5- images : {
6- unoptimized : true ,
7- } ,
8+ /* config options here */
9+ output : isProd ? 'export' : 'standalone' ,
10+ basePath : isProd ? '/Portfolio' : '' ,
11+ assetPrefix : isProd ? '/Portfolio/' : '' ,
12+ trailingSlash : true ,
813} ;
914
1015export default nextConfig ;
Original file line number Diff line number Diff line change 11{
22 "name" : " new-portfolio" ,
33 "version" : " 0.1.0" ,
4+ "homepage" : " https://roxylius.github.io/Portfolio/" ,
45 "private" : true ,
56 "scripts" : {
67 "dev" : " next dev" ,
You can’t perform that action at this time.
0 commit comments