Skip to content

Instantly share code, notes, and snippets.

@joho
Created October 4, 2014 01:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joho/ecfe17984d211fcbd293 to your computer and use it in GitHub Desktop.
Save joho/ecfe17984d211fcbd293 to your computer and use it in GitHub Desktop.
Building and deploying static sites to s3 with http://harpjs.com/
#!/bin/bash
### build
make clean all
### deploy
# script to export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (varies per project usually)
. ~/bin/aws_s3
# use http://aws.amazon.com/cli/ to sync up the folder to a bucket set up like http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
aws s3 sync dist/ s3://shoutcloud.io --region=ap-southeast-2 --delete --exclude '.*' --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
# Variables
SRC=src
DIST=dist
# Destroy the final targets
clean:
rm -rf $(DIST)/*
# Compile the final targets
all:
harp compile $(SRC) $(DIST)
server:
harp server $(SRC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment