Static site blog src for blog.dermah.com
You need git-lfs!
brew install git-lfs
git lfs installTo push and pull Git LFS objects (*.jpg, *.png), you may need to be running the local lfs server
npm run lfs-serverThis assumes you have the AWS CLI and credentials configured. Try using aws-vault to manage many profiles.
Using my own lfs-server has made this a chore. Just check out the lfs-server first:
git clone https://github.com/dermah/blog.dermah.com.git --no-checkout
cd blog.dermah.com
git checkout master package.json lfs-server/Run the server in another terminal:
npm run lfs-serverThen check out everything else:
git checkout master .npm installnpm run servenpm run build- Files present on S3 but not in
dist/are red. - New files to deploy to S3 are green.
npm run filediffIf you want to see the diff of the file contents:
npm run diff
# Or do this if you've already downloaded the bucket recently:
# npm run diff -- --show-onlynpm run deploy -- --dryrun
npm run deploy
npm run decacheUpdate the blog status, git add your changes then
npm version minor -f -m "<blog status>"
git push --follow-tags# brew install exiftool
exiftool -all= *.jpgRecommended max dimension: 1500px
You'll need the AWS CLI installed and configured.
CloudFront can only use ACM certificates from the us-east-1 region, so this stack must be deployed there. Set this environment variable to operate in us-east-1:
AWS_REGION=us-east-1aws cloudformation validate-template --template-body file://infrastructure.yml# BYOHostedZoneID=<Existing Hosted Zone>
aws cloudformation create-stack --template-body file://infrastructure.yml --stack-name blog-dermah-com --parameters \
ParameterKey=DomainName,ParameterValue=blog.dermah.com \
ParameterKey=BYOHostedZoneID,ParameterValue=$BYOHostedZoneID
aws cloudformation wait stack-create-complete --stack-name blog-dermah-com
aws cloudformation describe-stacks --stack-name blog-dermah-comaws cloudformation get-template --stack-name blog-dermah-com --query TemplateBody --output text | git diff --no-index - infrastructure.ymlaws cloudformation update-stack --template-body file://infrastructure.yml --stack-name blog-dermah-com --parameters \
ParameterKey=DomainName,UsePreviousValue=true \
ParameterKey=BYOHostedZoneID,UsePreviousValue=true
aws cloudformation wait stack-update-complete --stack-name blog-dermah-comaws cloudformation describe-stacks --stack-name blog-dermah-com
aws cloudformation describe-stacks --stack-name blog-dermah-com --query "Stacks[0].Outputs"
aws cloudformation describe-stack-events --stack-name blog-dermah-com --query "StackEvents[*].{ID:LogicalResourceId,Type:ResourceType,Status:ResourceStatus,Time:Timestamp,Reason:ResourceStatusReason}"Do this in your post front matter
draft: true # removes the item from collections
permalink: false # does not output the file during build