This repository was archived by the owner on Aug 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Sample workflow for building and deploying a React app with npm to GitHub Pages
2
+ name : Deploy React App to GitHub Pages
3
+
4
+ on :
5
+ push :
6
+ branches : ["master"] # Change to "main" if your default branch is main
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 :
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - name : Checkout code
23
+ uses : actions/checkout@v4
24
+
25
+ - name : Setup Node.js
26
+ uses : actions/setup-node@v4
27
+ with :
28
+ node-version : ' 20'
29
+
30
+ - name : Install dependencies
31
+ run : npm install
32
+
33
+ - name : Build the project
34
+ run : npm run build
35
+
36
+ - name : Upload artifact
37
+ uses : actions/upload-pages-artifact@v3
38
+ with :
39
+ path : ./dist # Change this to `./build` if you're using Create React App
40
+
41
+ deploy :
42
+ needs : build
43
+ runs-on : ubuntu-latest
44
+ environment :
45
+ name : github-pages
46
+ url : ${{ steps.deployment.outputs.page_url }}
47
+ steps :
48
+ - name : Deploy to GitHub Pages
49
+ id : deployment
50
+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments