Skip to content

ricardoapaes/action-s3-upload

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Upload/Download file to Amazon S3 - GitHub Action

This GitHub Action upload/downloa a file to amazon s3 with the option to add metadata.

Upload

- name: Upload to s3
  uses: ricardoapaes/action-s3-upload@latest
  env:
    AWS_KEY: ${{ secrets.AWS_KEY }}
    AWS_SECRET: ${{ secrets.AWS_SECRET }}
  with:
    bucket: name-of-bucket
    src: filename-to-upload.zip
    filename: filename-in-bucket.zip
    metadata: var1=example1,var2=example2
    region: us-east-1

Download

- name: Download from s3
  uses: ricardoapaes/action-s3-upload/download@latest
  env:
    AWS_KEY: ${{ secrets.AWS_KEY }}
    AWS_SECRET: ${{ secrets.AWS_SECRET }}
  with:
    bucket: name-of-bucket
    src: file-to-upload.zip
    dest: path-in-bucket.zip
    region: us-east-1