Created
October 7, 2018 15:18
-
-
Save alex3165/8d49e35c9ba719121fc96ede8ee07e77 to your computer and use it in GitHub Desktop.
Quick circleCI 2 config that works with react-script and deploy to aws
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults: &defaults | |
docker: | |
- image: jtredoux/node-aws:latest | |
version: 2 | |
jobs: | |
build: | |
<<: *defaults | |
steps: | |
- checkout | |
- run: npm install | |
- run: npm run build | |
- persist_to_workspace: | |
root: . | |
paths: | |
- build/* | |
deploy: | |
<<: *defaults | |
steps: | |
- checkout | |
- attach_workspace: | |
at: build | |
- run: aws configure set default.region eu-west-2 | |
- run: aws s3 sync build $S3_BUCKET --acl public-read --delete | |
workflows: | |
version: 2 | |
release_branches: | |
jobs: | |
- build | |
- deploy: | |
requires: | |
- build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment variables required:
AWS_ACCESS_KEY_ID
: Create a circleCI IAM user with full access to your S3 bucketAWS_SECRET_ACCESS_KEY
: Create a circleCI IAM user with full access to your S3 bucketS3_BUCKET
: your s3 bucket name (example:s3://my-bucket-name
)