Skip to content

Instantly share code, notes, and snippets.

@MFry
Last active October 16, 2019 12:20
Show Gist options
  • Save MFry/503a0f7dd7d806d0232b917555edfbb6 to your computer and use it in GitHub Desktop.
Save MFry/503a0f7dd7d806d0232b917555edfbb6 to your computer and use it in GitHub Desktop.
Permissions to deploy to S3 from a CI provider
language: node_js
node_js:
- node
cache:
yarn: true
directories:
- node_modules
script:
- mkdir -p build/css
- cp index.html build/
- ls build
- yarn run sass
- yarn run css-preprocess
- ls build
deploy:
provider: s3
access_key_id: "ACCESS_KEY"
secret_access_key:
secure: "w/EXAMPLE="
bucket: "YOUR BUCKET"
acl: public_read
skip_cleanup: true
local_dir: build
branches:
only:
- master
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::your_bucket_name"
]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:DeleteObject",
"s3:PutObjectAcl"
],
"Resource": [
"arn:aws:s3:::your_bucket_name/*"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment