Use DuploCloud to upload to S3 from Github Actions
The goal of this section is to show how you can upload to an S3 bucket from Github Actions.
This process is done in two basic steps:
Logs in to AWS ECR using Just-In-Time (JIT) AWS credentials from DuploCloud
Upload your website content to S3
To use any of the below examples you will need to change:
The local path to upload from, if it is not build
duplo_host
env var
TENANT_NAME
env var
BUCKET_NAME
env var
The following example uploads a single directory to S3.
It does not show more advanced things like the following items:
Setting cache control directives
Making the uploaded content public
Making AWS delete older content
This example uploads multiple directories to S3.
It assumes that the following is true:
There is a subfolder named static
, whose contents can be cached for one year.
The rest of the contents can change at any time, so the cache uses must-revalidate
.