circle-ci-config-for-nodejs-deploy-to-aws-s3 code example
Example: circle-ci-config-for-nodejs-deploy-to-aws-s3
version: 2.1
orbs:
aws-s3: circleci/[email protected]
jobs:
build:
docker:
- image: circleci/node:12.9.1-browsers
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
- ~/.npm
- ~/.cache
key: v1-dependencies-{{ checksum "package.json" }}
- run: yarn lint
- run: yarn size
- run: yarn test
- run: yarn build
- aws-s3/sync:
from: build
to: "s3://kriss-react-cicd/"
arguments: |
--acl public-read \
--cache-control "max-age=86400"
overwrite: true