Deploy React project to S3 by using CI/CD pipelines(Part 2)

1. Create buildspec.yml

version: 0.2

phases:
install:
commands:
- echo "Installing dependencies"
- npm install
build:
commands:
- echo "Building"
- npm run build
post_build:
commands:
- echo "Synchronizing"
- aws s3 sync build/ s3://pipeline-app-test --delete

2. CodeBuild

  • Github at Source provider (or other if you have other)
  • Repository in GitHub account
  • Select a repository from the list
  • The branch which you want to use for create a pipeline
  • Ubuntu
  • Standard
  • aws/codebuild/standard:5.0 (just select last version)

3. Bucket permissions

{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:DeleteObjectVersion",
"s3:GetObjectVersionAcl",
"s3:ListBucket",
"s3:DeleteObject",
"s3:PutObjectAcl",
"s3:GetObjectVersion"
],
"Resource": [
"arn:aws:s3:::pipeline-app-test/*",
"arn:aws:s3:::pipeline-app-test"
]
},

The final

--

--

ZenBit Tech is an outsourcing software development company spreading its services worldwide. http://zenbit.tech/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Zenbit Tech

Zenbit Tech

ZenBit Tech is an outsourcing software development company spreading its services worldwide. http://zenbit.tech/