Skip to content

Commit 92dbbff

Browse files
authored
Test deploy permissions (#197)
* Test deploying to s3 bucket * Add aws cli for testing * Add contexts to test deploy job * Try syncing the build directory to the bucket * Move the deployment to the deploy-production job * disable the aws setup on the preview deploy
1 parent 140622d commit 92dbbff

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.circleci/config.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ jobs:
182182
fi
183183
- notify_error:
184184
message: "Deploy preview job failed for branch ${CIRCLE_BRANCH}"
185+
# - aws-setup
186+
# - run:
187+
# name: Test S3 deployment
188+
# command: |
189+
# set -e
190+
# echo "[INFO] Testing deploy to S3 bucket..."
191+
# aws s3 sync build "s3://circleci-docs-platform-assets/docs/dorian/"
185192

186193
deploy-production:
187194
executor: node_executor
@@ -210,7 +217,7 @@ jobs:
210217
211218
set -e
212219
echo "[INFO] Deploying production site..."
213-
aws s3 cp "$BUILD_DIRECTORY" "s3://$AWS_S3_BUCKET/$BUCKET_DIRECTORY/" --recursive
220+
aws s3 sync "$BUILD_DIRECTORY" "s3://$AWS_S3_BUCKET/$BUCKET_DIRECTORY/"
214221
- notify_error:
215222
message: "Production deployment job failed for branch ${CIRCLE_BRANCH}"
216223

@@ -276,13 +283,25 @@ workflows:
276283
filters:
277284
branches:
278285
ignore: main
279-
context: circleci-docs-static
286+
context:
287+
[
288+
circleci-docs-static,
289+
docs-platform-assets,
290+
web-ui-npm,
291+
web-ui-datadog,
292+
]
280293
- deploy-production:
281294
requires: [validate]
282295
filters:
283296
branches:
284297
only: main
285-
context: [circleci-docs-static, web-ui-org-settings, org-global]
298+
context:
299+
[
300+
circleci-docs-static,
301+
docs-platform-assets,
302+
web-ui-npm,
303+
web-ui-datadog,
304+
]
286305
bucket_dir: "dorian"
287306
bucket_name: "circleci-docs-platform-assets/docs"
288307
build_dir: "build"

0 commit comments

Comments
 (0)