From 5e6e55ab58967009beb415be142d2b6a1ca89d69 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Mon, 16 Sep 2019 13:20:54 -0400 Subject: [PATCH] Clarify latest changes in v0.3.0 in README.md --- README.md | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f63c1d0..27f9114 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ This simple action uses the [vanilla AWS CLI](https://docs.aws.amazon.com/cli/index.html) to sync a directory (either from your repository or generated during your workflow) with a remote S3 bucket. -**Performing this action deletes any files in the bucket that are *not* present in the source directory.** Working on making this optional in the next release! ## Usage @@ -12,6 +11,8 @@ This simple action uses the [vanilla AWS CLI](https://docs.aws.amazon.com/cli/in Place in a `.yml` file such as this one in your `.github/workflows` folder. [Refer to the documentation on workflow YAML syntax here.](https://help.github.com/en/articles/workflow-syntax-for-github-actions) +As of v0.3.0, all [`aws s3 sync` flags](https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html) are optional to allow for maximum customizability (that's a word, I promise) and must be provided by you via `args:`. The optimal defaults for a static website are set in this example: `--acl public-read` makes your files publicly readable, `--follow-symlinks` won't hurt and fixes some weird symbolic link problems that may come up, and most importantly, `--delete` **permanently deletes** files in the S3 bucket that are **not** present in the latest version of your repository/build. + ```yaml name: Sync Bucket on: push @@ -23,7 +24,7 @@ jobs: - uses: actions/checkout@master - uses: jakejarvis/s3-sync-action@master with: - args: --acl public-read + args: --acl public-read --follow-symlinks --delete env: SOURCE_DIR: './public' AWS_REGION: 'us-east-1' @@ -33,23 +34,17 @@ jobs: ``` -### Required Environment Variables - -| Key | Value | Type | Required | -| ------------- | ------------- | ------------- | ------------- | -| `AWS_REGION` | The region where you created your bucket in. For example, `us-east-1`. [Full list of regions here.](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions) | `env` | **Yes** | -| `SOURCE_DIR` | The local directory you wish to sync/upload to S3. For example, `./public`. Defaults to the root of your repository if not provided. | `env` | No | - +### Configuration -### Required Secret Variables +The following settings must be passed as environment variables as shown in the example. Sensitive information, especially `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`, should be [set as encrypted secrets](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) — otherwise, they'll be public to anyone browsing your repository. -The following variables should be added as "secrets" in the action's configuration. - -| Key | Value | Type | Required | +| Key | Value | Suggested Type | Required | | ------------- | ------------- | ------------- | ------------- | -| `AWS_S3_BUCKET` | The name of the bucket you're syncing to. For example, `jarv.is`. | `secret` | **Yes** | | `AWS_ACCESS_KEY_ID` | Your AWS Access Key. [More info here.](https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) | `secret` | **Yes** | | `AWS_SECRET_ACCESS_KEY` | Your AWS Secret Access Key. [More info here.](https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) | `secret` | **Yes** | +| `AWS_S3_BUCKET` | The name of the bucket you're syncing to. For example, `jarv.is`. | `secret` | **Yes** | +| `AWS_REGION` | The region where you created your bucket in. For example, `us-east-1`. [Full list of regions here.](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions) | `env` | **Yes** | +| `SOURCE_DIR` | The local directory you wish to sync/upload to S3. For example, `./public`. Defaults to the root of your repository (`.`) if not provided. | `env` | No | ## License