Skip to content

a GitHub action that automate deployment of files to S3

License

Notifications You must be signed in to change notification settings

kaskadi/action-s3cp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status Static code analysis status Docs generation status

CodeClimate


What is this action for?

This action allows you to upload files to a given S3 bucket.

How to use it?

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 from master or replaced by the current version if the action is triggered from release/vx.x.x

About

a GitHub action that automate deployment of files to S3

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •