Skip to content

Instantly share code, notes, and snippets.

@hemc4
Created February 11, 2017 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hemc4/c79d163579c9931b6dafb90c92ed1d27 to your computer and use it in GitHub Desktop.
Save hemc4/c79d163579c9931b6dafb90c92ed1d27 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
DISTRIBUTION_ID=E6VHHP64I3KLD
BUCKET_NAME=hemc.io-cdn
# Copy over pages - not static js/img/css/downloads
aws s3 sync --acl "public-read" --sse "AES256" public/ s3://$BUCKET_NAME --exclude 'post'
# Invalidate root page and page listings
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths /index.html / /post/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment