Day 12: Sync with S3
December 12, 2019
jakejarvis/s3-sync-action is a wrapper for the AWS S3 client so you can send files into your S3 Buckets.
Example Usage
An Example workflow could be uploading a directory into a S3 bucket for things like publishing a static website. With AWS, you’ll need the default AWS credentials, the bucket, and the directory you want to sync. With an args
parameter, you can pass in any of the flags from the aws s3
cli command.
name: Upload Websiteon:push:branches:- masterjobs:deploy:runs-on: ubuntu-lateststeps:- uses: actions/checkout@master- uses: jakejarvis/s3-sync-action@masterwith:args: --acl public-read --follow-symlinks --deleteenv:AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}AWS_REGION: 'us-west-1' # optional: defaults to us-east-1SOURCE_DIR: 'public' # optional: defaults to entire repository