Makefile Recipes for Real Projects/Deploy static site to S3

Sync built files to a bucket and invalidate a CDN.

Section: Infrastructure and deployment recipes

Deploy static site to S3

makefile
makefile
deploy-web:
	aws s3 sync dist/ s3://$(WEB_BUCKET) --delete
	aws cloudfront create-invalidation --distribution-id $(DIST_ID) --paths '/*'
Explanation

A realistic cloud deployment target.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Infrastructure and deployment recipes
Docker build target
Build a container image with a version tag.
OpenIn sheetmakefilesame section
Docker push target
Push a previously built image.
OpenIn sheetmakefilesame section
Terraform plan target
Run a named plan file for a chosen environment.
OpenIn sheetmakefilesame section
Terraform apply target
Apply the previously generated plan.
OpenIn sheetmakefilesame section
Help target
List available targets and descriptions.
OpenIn sheetmakefile
Node.js targets
Lint, test, and build JavaScript or TypeScript projects.
OpenIn sheetmakefile