'made codebuild project that uploads frontend to s3'
2 files changed, +41 -0
+13-0Client/bucket-policy.json
| @@ -0,0 +1,13 @@ | ||
| 1 | +{ | |
| 2 | + "Version": "2012-10-17", | |
| 3 | + "Id": "hygo.real-e-state.bucket-policy", | |
| 4 | + "Statement": [ | |
| 5 | + { | |
| 6 | + "Sid": "PublicReadGetObject", | |
| 7 | + "Effect": "Allow", | |
| 8 | + "Principal": "*", | |
| 9 | + "Action": "s3:GetObject", | |
| 10 | + "Resource": "arn:aws:s3:::hygo.real-e-state/*" | |
| 11 | + } | |
| 12 | + ] | |
| 13 | +} |
+28-0buildspec.yml
| @@ -0,0 +1,28 @@ | ||
| 1 | +version: 0.2 | |
| 2 | + | |
| 3 | +env: | |
| 4 | + variables: | |
| 5 | + REACT_APP_BASE_URL: "http://localhost:5001/" | |
| 6 | + | |
| 7 | +phases: | |
| 8 | + install: | |
| 9 | + commands: | |
| 10 | + - echo Installing dependencies... | |
| 11 | + - cd Client && npm i | |
| 12 | + - cd ../server && npm i | |
| 13 | + | |
| 14 | + build: | |
| 15 | + commands: | |
| 16 | + - cd Client | |
| 17 | + - echo Running npm run build in the Client folder... | |
| 18 | + - npm run build | |
| 19 | + | |
| 20 | + post_build: | |
| 21 | + commands: | |
| 22 | + # Copy the build output to your S3 bucket | |
| 23 | + - echo Copying build files to S3 bucket... | |
| 24 | + - aws s3 sync ./Client/build/ s3://hygo.real-estate/ --delete | |
| 25 | +cache: | |
| 26 | + paths: | |
| 27 | + - Client/node_modules | |
| 28 | + - server/node_modules |