Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethers-io/sync-s3-action
GitHub Action to sync an S3 bucket with a folder.
https://github.com/ethers-io/sync-s3-action
actions aws github-actions
Last synced: 8 days ago
JSON representation
GitHub Action to sync an S3 bucket with a folder.
- Host: GitHub
- URL: https://github.com/ethers-io/sync-s3-action
- Owner: ethers-io
- Created: 2022-10-20T23:43:30.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-21T00:48:34.000Z (about 2 years ago)
- Last Synced: 2024-04-14T00:59:35.760Z (7 months ago)
- Topics: actions, aws, github-actions
- Language: JavaScript
- Size: 414 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sync S3
=======This action syncs a folder to an S3 Bucket, uploading only files which have
changed and optionally invalidates any Cloudfront edge caches.Configuration
-------------**workflow.yml**
```
name: Sync to S3on:
push:
bracnhes:
- masterjobs:
sync-website:
name: Sync Website to S3runs-on: ubuntu-latest
steps:
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x- name: Checkout repository
uses: actions/checkout@v2- name: Sync to S3
uses: ethers-io/sync-s3-action
with:
aws_access_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_s3_bucket: ${{ secrets.AWS_BUCKET }}
source_folder: 'foo/bar/'
source_prefix: 'foo/'
destination_prefix: 'another-foo/'
aws_cloudfront_id: ZQWX4KGLS45
```**IAM Permissions**
You must substitute your own ARN for the CloudFront and S3 resources.
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:PutObjectVersionAcl",
"s3:ListBucket",
"cloudfront:CreateInvalidation",
"s3:PutObjectAcl"
],
"Resource": [
"arn:aws:cloudfront::USER_ID:distribution/DISTRIBUTION_ID",
"arn:aws:s3:::your.bucket.here",
"arn:aws:s3:::your.bucket.here/*"
]
}
]
}
```License
-------MIT License.