File tree Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy Next.js site to Pages
2
+
3
+ on :
4
+ # Runs on pushes targeting the default branch
5
+ push :
6
+ branches : ["main"]
7
+ # Allows you to run this workflow manually from the Actions tab
8
+ workflow_dispatch :
9
+
10
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11
+ permissions :
12
+ contents : read
13
+ pages : write
14
+ id-token : write
15
+
16
+ # Allow one concurrent deployment
17
+ concurrency :
18
+ group : " pages"
19
+ cancel-in-progress : true
20
+
21
+ jobs :
22
+ # Build job
23
+ build :
24
+ runs-on : ubuntu-latest
25
+ steps :
26
+ - name : Checkout
27
+ uses : actions/checkout@v3
28
+ - uses : pnpm/action-setup@v2
29
+ with :
30
+ version : 8
31
+ - name : Setup Node
32
+ uses : actions/setup-node@v3
33
+ with :
34
+ cache : ' pnpm'
35
+ - name : Setup Pages
36
+ uses : actions/configure-pages@v2
37
+ - name : Restore cache
38
+ uses : actions/cache@v3
39
+ with :
40
+ path : |
41
+ .ssr-test/cache
42
+ # Generate a new cache whenever packages or source files change.
43
+ key : ${{ runner.os }}-ssr-test-${{ hashFiles('**/pnpm-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
44
+ # If source files changed but packages didn't, rebuild from a prior cache.
45
+ restore-keys : |
46
+ ${{ runner.os }}-ssr-test-${{ hashFiles('**/pnpm-lock.json') }}-
47
+ - name : Install dependencies
48
+ run : pnpm install --no-frozen-lockfile
49
+ - name : Build
50
+ run : |
51
+ export NODE_OPTIONS=--max_old_space_size=8193
52
+ pnpm build
53
+ - name : Collect static pages
54
+ run : pnpm build:pages
55
+ - name : Upload artifact
56
+ uses : actions/upload-pages-artifact@v1
57
+
58
+ # Deployment job
59
+ deploy :
60
+ environment :
61
+ name : github-pages
62
+ url : ${{ steps.deployment.outputs.page_url }}
63
+ runs-on : ubuntu-latest
64
+ needs : build
65
+ steps :
66
+ - name : Deploy to GitHub Pages
67
+ id : deployment
68
+ uses : actions/deploy-pages@v1
Original file line number Diff line number Diff line change 2
2
"name" : " ssr-test-cra" ,
3
3
"version" : " 0.0.0" ,
4
4
"private" : true ,
5
+ "homepage" : " /ssr-test/cra" ,
5
6
"scripts" : {
6
7
"start" : " serve -s build -l 3000" ,
7
8
"dev" : " react-scripts start" ,
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
reactStrictMode : true ,
3
3
transpilePackages : [ "raw-and-dist-src" ] ,
4
+ basePath : '/ssr-test/next'
4
5
} ;
You can’t perform that action at this time.
0 commit comments