Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active May 4, 2024 05:59
Show Gist options
  • Save wilmoore/8d85ea1aa9ab5306eb54 to your computer and use it in GitHub Desktop.
Save wilmoore/8d85ea1aa9ab5306eb54 to your computer and use it in GitHub Desktop.
Software Engineering :: Cloud :: AWS :: Amazon S3 :: AWS s3 Static File Deployment

Software Engineering :: Cloud :: AWS :: Amazon S3 :: AWS s3 Static File Deployment

⪼ Made with 💜 by Polyglot.

#!/usr/bin/env bash
# bucket name
BUCKET_NAME="TARGET-BUCKET-HERE"
# create bucket (idempotent)
s3cmd mb s3://$BUCKET_NAME
# put index.html
s3cmd put --acl-public index.html s3://$BUCKET_NAME/index.html
# sync assets directory
s3cmd put --recursive --acl-public assets s3://$BUCKET_NAME/
# open in default web browser
open http://$BUCKET_NAME.s3.amazonaws.com/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment