File tree Expand file tree Collapse file tree 4 files changed +88
-0
lines changed Expand file tree Collapse file tree 4 files changed +88
-0
lines changed Original file line number Diff line number Diff line change
1
+ REACT_APP_API_URL = http://3.149.228.186:8080/api
Original file line number Diff line number Diff line change
1
+ name : Build & Deploy
2
+
3
+ on :
4
+ push :
5
+ branches : [ "master" ]
6
+ pull_request :
7
+ branches : [ "master" ]
8
+
9
+ jobs :
10
+ build :
11
+ runs-on : ubuntu-latest
12
+
13
+ strategy :
14
+ matrix :
15
+ node-version : ["20.x"]
16
+
17
+ steps :
18
+ - name : Use Node.js ${{ matrix.node-version }}
19
+ uses : actions/setup-node@v3
20
+ with :
21
+ node-version : ${{ matrix.node-version }}
22
+
23
+ - name : Checkout repository
24
+ uses : actions/checkout@v2
25
+
26
+ - name : Install packages
27
+ run : yarn install
28
+
29
+ - name : Build
30
+ run : |
31
+ unset CI
32
+ yarn build:prod
33
+
34
+ - name : Upload build artifacts
35
+ uses : actions/upload-artifact@v2
36
+ with :
37
+ name : build
38
+ path : build
39
+
40
+ deploy :
41
+ if : ${{ github.ref == 'refs/heads/master' }}
42
+ needs :
43
+ - build
44
+ runs-on : ubuntu-latest
45
+ steps :
46
+ - name : Download build artifacts
47
+ uses : actions/download-artifact@v2
48
+ with :
49
+ name : build
50
+ path : build
51
+
52
+ - name : Deploy to S3
53
+ uses : jakejarvis/s3-sync-action@master
54
+ with :
55
+ args : --delete
56
+ env :
57
+ AWS_S3_BUCKET : ${{ secrets.AWS_BUCKET_NAME }}
58
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
59
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
60
+ AWS_REGION : ${{ secrets.AWS_REGION }}
61
+ SOURCE_DIR : " build"
Original file line number Diff line number Diff line change 22
22
"chart.js" : " ^4.4.3" ,
23
23
"dayjs" : " ^1.11.12" ,
24
24
"install" : " ^0.13.0" ,
25
+ "env-cmd" : " ^10.1.0" ,
25
26
"lodash" : " ^4.17.21" ,
26
27
"npm" : " ^10.8.2" ,
27
28
"react" : " ^18.3.1" ,
38
39
"scripts" : {
39
40
"start" : " react-scripts start" ,
40
41
"build" : " react-scripts build" ,
42
+ "build:prod" : " env-cmd -f .env.prod react-scripts build" ,
41
43
"test" : " react-scripts test" ,
42
44
"eject" : " react-scripts eject"
43
45
},
You can’t perform that action at this time.
0 commit comments