diff --git a/Dockerfile b/Dockerfile index ddcf50a..7b26960 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,13 +5,13 @@ LABEL "com.github.actions.description"="Sync a directory to an AWS S3 repository LABEL "com.github.actions.icon"="refresh-cw" LABEL "com.github.actions.color"="green" -LABEL version="0.5.1" +LABEL version="0.6.1" LABEL repository="https://github.com/jakejarvis/s3-sync-action" LABEL homepage="https://jarv.is/" LABEL maintainer="Jake Jarvis " # https://github.com/aws/aws-cli/blob/master/CHANGELOG.rst -ENV AWSCLI_VERSION='1.17.1' +ENV AWSCLI_VERSION='1.18.201' RUN pip install --quiet --no-cache-dir awscli==${AWSCLI_VERSION} diff --git a/README.md b/README.md index ecd0d31..5a075d0 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ The following settings must be passed as environment variables as shown in the e | `AWS_S3_BUCKET` | The name of the bucket you're syncing to. For example, `jarv.is` or `my-app-releases`. | `secret env` | **Yes** | N/A | | `AWS_REGION` | The region where you created your bucket. Set to `us-east-1` by default. [Full list of regions here.](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions) | `env` | No | `us-east-1` | | `AWS_S3_ENDPOINT` | The endpoint URL of the bucket you're syncing to. Can be used for [VPC scenarios](https://aws.amazon.com/blogs/aws/new-vpc-endpoint-for-amazon-s3/) or for non-AWS services using the S3 API, like [DigitalOcean Spaces](https://www.digitalocean.com/community/tools/adapting-an-existing-aws-s3-application-to-digitalocean-spaces). | `env` | No | Automatic (`s3.amazonaws.com` or AWS's region-specific equivalent) | +| `AWS_S3_MULTIPART_THRESHOLD` | When uploading, downloading, or copying a file, the S3 commands will switch to multipart operations if the file reaches a given size threshold. The [multipart_threshold](https://docs.aws.amazon.com/cli/latest/topic/s3-config.html#multipart-threshold) controls this value. | `env` | No | 8MB | | `SOURCE_DIR` | The local directory (or file) you wish to sync/upload to S3. For example, `public`. Defaults to your entire repository. | `env` | No | `./` (root of cloned repository) | | `DEST_DIR` | The directory inside of the S3 bucket you wish to sync/upload to. For example, `my_project/assets`. Defaults to the root of the bucket. | `env` | No | `/` (root of bucket) | diff --git a/entrypoint.sh b/entrypoint.sh index 466e69c..a74f281 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,6 +37,10 @@ ${AWS_REGION} text EOF +if [ -n "$AWS_S3_MULTIPART_THRESHOLD" ]; then + sh -c "aws configure set s3.multipart_threshold ${AWS_S3_MULTIPART_THRESHOLD} --profile s3-sync-action" +fi + # Sync using our dedicated profile and suppress verbose messages. # All other flags are optional via the `args:` directive. sh -c "aws s3 sync ${SOURCE_DIR:-.} s3://${AWS_S3_BUCKET}/${DEST_DIR} \