Skip to content

Instantly share code, notes, and snippets.

@joho
Created Oct 4, 2014
Embed
What would you like to do?
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