Skip to content

Commit 43fbfad

Browse files
committed
docs: update README
1 parent 27e7013 commit 43fbfad

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,45 @@
11
# GitHub Action to Sync S3 Bucket and invalidate CloudFront Cache
22

3-
Uses official [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image to sync a directory with a S3 bucket.
3+
> Uses official [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image to sync a directory with a S3 bucket.
44
55
Before start configure your [AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-creds-create)
66

7+
## Usage
8+
9+
Example `workflow.yml`:
10+
11+
```yaml
12+
13+
name: S3 Deployment
14+
on: push
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
- name: Build App
25+
run: npm run build
26+
- name: S3/CloudFront Deploy
27+
uses: staevs/[email protected]
28+
if: success()
29+
with:
30+
args: --follow-symlinks --delete --no-progress
31+
env:
32+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
33+
AWS_REGION: ${{ secrets.AWS_REGION }}
34+
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
35+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36+
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
37+
S3_SOURCE_DIR: 'build'
38+
```
39+
40+
## Configuration
41+
42+
> `args` would be passed directly to `aws s3` invocation. Refer to: [AWS S3 docs](https://docs.aws.amazon.com/cli/latest/userguide/cli-services-s3.html)
743

844
| Environment Variable | Required | Description |
945
|----------------------------|-----------------------------|------------------------------------------------------------------------------------------------------------------|

0 commit comments

Comments
 (0)