Skip to content

dominicporter/s3-cp-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action to aws s3 cp a file to an S3 Bucket πŸ”„

⚠️ Note: To use this action, you must have access to the GitHub Actions feature. GitHub Actions are currently only available in public beta. You can apply for the GitHub Actions beta here.

This simple action uses the vanilla AWS CLI to sync a directory (either from your repository or generated during your workflow) with a remote S3 bucket.

Usage

workflow.yml Example

Place in a .yml file such as this one in your .github/workflows folder. Refer to the documentation on workflow YAML syntax here.

name: Sync Bucket
on: push

jobs:
  deploy:
    runs-on: ubuntu-latest
    
    steps:
   - uses: actions/checkout@master
   
   - name: Upload binary to S3 bucket
   uses: tpaschalis/s3-sync-action@master
   with:
     args: --acl public-read
   env:
     FILE: ./gh-actions-golang
     AWS_REGION: 'eu-central-1'
     AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
     AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
     AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_SECRET }}

Required Environment Variables

Key Value Type Required
FILE The local file you wish to upload to S3. For example, ./myfile.txt. env Yes
AWS_REGION The region where you created your bucket in. For example, eu-central-1. Full list of regions here. env Yes

Required Secret Variables

The following variables should be added as "secrets" in the action's configuration.

Key Value Type Required
AWS_S3_BUCKET The name of the bucket you're syncing to. For example, golang-deployment-bucket. secret Yes
AWS_ACCESS_KEY_ID Your AWS Access Key. More info here. secret Yes
AWS_SECRET_ACCESS_KEY Your AWS Secret Access Key. More info here. secret Yes

License

This project is distributed under the MIT license.

About

GitHub Action to `cp` a file to a remote S3 bucket. Forked from jakejarvis/s3-sync-action

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 70.4%
  • Shell 29.6%