Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
estevao90 committed Dec 17, 2024
1 parent 750b94d commit abfeec0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 24 deletions.
71 changes: 50 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ of the commands provided by this GitHub Action. Sensitive information, especiall
they'll be public to anyone browsing your repository's source code and
CI logs.

| Key | Value | Suggested Type | Required | Default |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| `COMMAND` | The action command (see below) you wish to execute | `env` | **Yes** | N/A |
| `S3_ACCESS_KEY_ID` | Your AWS Access Key. [More info here.](https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) | `secret env` | **Yes** | N/A |
| `S3_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 env` | **Yes** | N/A |
| `S3_BUCKET` | The name of the bucket you're syncing to. For example, `jarv.is` or `my-app-releases`. | `secret env` | **Yes** | N/A |
| `S3_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` |
| `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) |

| Key | Value | Suggested Type | Required | Default |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------- | ------------------------------------------------------------------ |
| `COMMAND` | The action command (see below) you wish to execute | `env` | **Yes** | N/A |
| `S3_ACCESS_KEY_ID` | Your AWS Access Key. [More info here.](https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) | `secret env` | **Yes** | N/A |
| `S3_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 env` | **Yes** | N/A |
| `S3_BUCKET` | The name of the bucket you're syncing to. For example, `jarv.is` or `my-app-releases`. | `secret env` | **Yes** | N/A |
| `S3_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` |
| `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) |

## Commands

Expand Down Expand Up @@ -47,9 +46,9 @@ You can add the following as a step in one of your workflows:

Additional configuration for this command:

| Key | Value | Suggested Type | Required | Default |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| `FILE` | The file you want to check for the existence of | `env` | No | `/` (root of bucket) |
| Key | Value | Suggested Type | Required | Default |
| ------ | ----------------------------------------------- | -------------- | -------- | ------- |
| `FILE` | The file you want to check for the existence of | `env` | Yes | N/A |

### `ls`

Expand All @@ -76,9 +75,9 @@ You can add the following as a step in one of your workflows:

Additional configuration for this command:

| Key | Value | Suggested Type | Required | Default |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| `FILE` | The file you want to check for the existence of | `env` | No | `/` (root of bucket) |
| Key | Value | Suggested Type | Required | Default |
| ------ | ----------------------------------------------- | -------------- | -------- | ------- |
| `FILE` | The file you want to check for the existence of | `env` | Yes | N/A |

### `rm`

Expand All @@ -105,9 +104,9 @@ You can add the following as a step in one of your workflows:

Additional configuration for this command:

| Key | Value | Suggested Type | Required | Default |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| `FILE` | The file you want to check for the existence of | `env` | No | `/` (root of bucket) |
| Key | Value | Suggested Type | Required | Default |
| ------ | ----------------------------------------------- | -------------- | -------- | ------- |
| `FILE` | The file you want to check for the existence of | `env` | Yes | N/A |

### `sync`

Expand All @@ -134,6 +133,36 @@ You can add the following as a step in one of your workflows:

Additional configuration for this command:

| Key | Value | Suggested Type | Required | Default |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| `SOURCE_DIR` | The file or directory you wish to sync | `env` | No | `/` (root of bucket) |
| Key | Value | Suggested Type | Required | Default |
| ------------ | -------------------------------------- | -------------- | -------- | -------------------- |
| `SOURCE_DIR` | The file or directory you wish to sync | `env` | No | `/` (root of bucket) |

### `cp`

This command performs `aws s3 cp`.

#### `workflow.yml` Step Example

You can add the following as a step in one of your workflows:

```
- name: S3 cp
uses: the-events-calendar/action-s3-utility@main
env:
COMMAND: cp
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
S3_REGION: ${{ secrets.S3_REGION }}
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
FILE: 'some-file-name.txt'
DESTINATION: 'some-dir/some-file-name.txt'
```

#### Configuration

Additional configuration for this command:

| Key | Value | Suggested Type | Required | Default |
| ------------- | ---------------------------- | -------------- | -------- | ------- |
| `DESTINATION` | The destination file or dir. | `env` | Yes | N/A |
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'S3 Utility'
description: 'Execute various s3 (ls, sync, rm) and s3 helper commands (exists)'
description: 'Execute various s3 (ls, sync, rm, cp) and s3 helper commands (exists)'
author: 'The Events Calendar (support@theeventscalendar.com)'
branding:
icon: file
Expand Down
2 changes: 0 additions & 2 deletions commands/cp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ echo $the_command
output=$(sh -c "$the_command")

echo $output

echo "::set-output name=ls_output::${output}"

0 comments on commit abfeec0

Please sign in to comment.