CodeClimate
This action allows you to upload files to a given S3 bucket.
You can use the following code as a new GitHub Actions Workflow:
name: {YOUR-ACTION-NAME}
on: [{YOUR-ACTION-EVENT}]
jobs:
{YOUR-JOB-NAME}:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: {YOUR-STEP-NAME}
uses: kaskadi/action-s3cp@master
env:
AWS_KEY_ID: {AWS_KEY_ID-VALUE}
AWS_KEY_SECRET: {AWS_KEY_SECRET-VALUE}
BUCKET: {BUCKET-VALUE}
Note: everything contained in single curly brackets ({ }
) needs to be replaced by your desired values
Environment variables:
Variable | Required | Description |
---|---|---|
AWS_KEY_ID |
true |
ID of a programmatic access AWS key attached to an IAM role which has permission to put an object into your target S3 bucket. Recommend implementing into repository secrets! |
AWS_KEY_SECRET |
true |
Secret of a programmatic access AWS key attached to an IAM role which has permission to put an object into your target S3 bucket. Recommend implementing into repository secrets! |
BUCKET |
true |
Target bucket for file upload. For upload configuration, see below. |
Upload configuration:
In order to tell the action which file to upload to S3, you need to add the following field into your package.json
file (root level):
"kaskadi": {
"s3-push": {
"files": [
{
"src": "file1.ext",
"dest": "path/to/{branch}file1.ext"
},
{
"src": "path/to/file2.ext",
"dest": "path/to/{branch}where/is/file2.ext"
},
{
"src": "folder1/",
"dest": "path/to/folder1/"
}
]
}
}
Notes:
- uploading a folder will always do a recursive upload
- the placeholder
{branch}
is removed if the action is triggered frommaster
or replaced by the current version if the action is triggered fromrelease/vx.x.x