11---
22version : 2.1
33orbs :
4- aws-s3 : circleci/aws-s3@1.0.11
5- aws-cli : circleci/aws-cli@0.1.18
4+ aws-s3 : circleci/aws-s3@1.0.15
65 queue : eddiewebb/queue@1.3.0
76 slack : circleci/slack@3.4.2
8- version-tag : commitdev/version-tag@0.0.3
97
108variables :
119 - &workspace /home/circleci/project
@@ -138,34 +136,30 @@ jobs:
138136 - persist_to_workspace :
139137 root : /home/circleci/project
140138 paths :
141- - public
139+ - build
142140
143141 - save_cache : # Store cache in the /go/pkg directory
144142 key : v1-pkg-cache-{{ checksum "yarn.lock" }}
145143 paths :
146144 - " node_modules"
147145
148- - store_test_results :
149- path : test-reports
150-
151- - store_artifacts :
152- path : test-reports
153-
154146 # Requires the SLACK_WEBHOOK
155147 - slack/notify-on-failure
156148
157149 deploy :
158150 docker :
159- - image : cimg/base:2019.10
151+ - image : cimg/python:3.6
152+ parameters :
153+ bucket :
154+ description : The S3 Bucket to sync files to.
155+ type : string
160156 steps :
161- - run : *checkout-shallow
162- - version-tag/get
163- - aws-cli/install
164- - aws-cli/setup
165- - run :
166- name : Upload to S3
167- command : |
168- ls public
157+ - attach_workspace :
158+ at : *workspace
159+ - aws-s3/sync :
160+ from : build
161+ overwrite : true
162+ to : ' s3://<< parameters.bucket >>'
169163
170164workflows :
171165 version : 2
@@ -183,9 +177,23 @@ workflows:
183177 - unit_test
184178
185179 - deploy :
180+ name : deploy_staging
181+ requires :
182+ - build
183+ bucket : <% index .Params `stagingBucket` %>
184+ # Depending on your development flow you may want to also only deploy to staging on master.
185+ # filters:
186+ # branches:
187+ # only: # only branches matching the below regex filters will run
188+ # - /^master$/
189+
190+ - deploy :
191+ name : deploy_production
186192 requires :
187193 - build
194+ - deploy_staging
195+ bucket : <% index .Params `productionBucket` %>
188196 filters :
189197 branches :
190198 only : # only branches matching the below regex filters will run
191- - /^master$/
199+ - /^master$/
0 commit comments