File tree Expand file tree Collapse file tree 3 files changed +384
-0
lines changed Expand file tree Collapse file tree 3 files changed +384
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy React App to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : ['main']
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ concurrency :
14+ group : ' pages'
15+ cancel-in-progress : true
16+
17+ jobs :
18+ deploy :
19+ environment :
20+ name : github-pages
21+ url : ${{ steps.deployment.outputs.page_url }}
22+ runs-on : ubuntu-latest
23+
24+ steps :
25+ - name : Checkout repository
26+ uses : actions/checkout@v3
27+
28+ - name : Set up Node.js
29+ uses : actions/setup-node@v3
30+ with :
31+ node-version : ' 20.x'
32+ cache : ' npm'
33+
34+ - name : Install dependencies
35+ run : npm install
36+
37+ - name : Build the React app
38+ run : npm run build
39+
40+ - name : Configure GitHub Pages
41+ uses : actions/configure-pages@v3
42+
43+ - name : Upload artifact
44+ uses : actions/upload-pages-artifact@v1
45+ with :
46+ path : ' ./dist'
47+
48+ - name : Deploy to GitHub Pages
49+ id : deployment
50+ uses : actions/deploy-pages@v1
You can’t perform that action at this time.
0 commit comments