accordproject / cicero-template-library

Accord Project Template Library
https://templates.accordproject.org
Apache License 2.0
80 stars 93 forks source link

chore(github) - invalidate AWS CloudFront Distribution #403

Closed martinhalford closed 2 years ago

martinhalford commented 2 years ago

Changes

Added logic to invalidate AWS CloudFront Distribution after each S3 deployment.

The CloudFront Distribution needs to be invalidated after each deployment in order to trigger a refresh of all the various endpoint caches in different geographies. Without this, stale files will be cached at the end points which will only be refreshed over time. Invalidations take a few minutes to propagate and ensure end users are served the latest deployed code as soon as possible.

Flags

The following secrets will need to be added to the repo.

AWS_CLOUDFRONT_DISTRIBUTION_ID : EJBEM5ZGYPK1V
AWS_REGION : us-east-1

The invalidation is created after each deployment to S3 and can be seen here: https://console.aws.amazon.com/cloudfront/v3/home?region=us-east-1#/distributions/ENZKBANCEVDP6/invalidations