Upload to S3 bucket

Use DuploCloud to upload to S3 from Github Actions

Introduction

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

Example workflows

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

Upload a single directory

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

Uploading directories with cache settings

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.

Last updated

Was this helpful?