Update CloudFront
Use DuploCloud to update your CloudFront from Github Actions
Introduction
The goal of this section is to show how you can upload to an S3 bucket and update a CloudFront distribution from Github Actions.
This process is done in four basic steps:
Logs in to AWS ECR using Just-In-Time (JIT) AWS credentials from DuploCloud
Build your website content
Upload your website content to S3
Inform AWS CloudFront that the website content has changed
NOTE: The example workflow assumes that all the website content is uploaded from a single subfolder named build
. It also makes extremely conservative assumptions about cache lifetimes. Your actual website content may allow a more optimal cache lifetime.
IMPORTANT: Steps to build website content are application specific and outside of the scope of this document. Please replace the example step in the workflow with the steps needed by your application's website.
Example workflow
To use it you will need to change the following:
The steps used to build your website content
duplo_host
env varCLOUDFRONT_ID
env varTENANT_NAME
env varBUCKET_NAME
env var
You also likely will need to change the paths and AWS CLI arguments used to upload your website content.
Last updated