My personal website and blog https://earnestma.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

49 lines
1.2 KiB

DOMAIN = earnestma.com
HUGO_BASEURL = https://$(DOMAIN)/
HUGO_FLAGS += --gc
USER = earne@$(DOMAIN)
WWW_ROOT = /home/earne/$(DOMAIN)
WWW_RSYNC_DEST = $(USER):$(WWW_ROOT)
OUTPUT_DIR = public
.PHONY: hugo
hugo: clean
cp data/recipes.yaml static/recipes.yaml
hugo -b $(HUGO_BASEURL) $(HUGO_FLAGS)
.PHONY: clean
clean: ## Remove temporary and build files
rm -rf $(OUTPUT_DIR)
rm -rf static/recipes.yaml
.PHONY: serve
serve: ## Start a development server, by default on localhost:1313
hugo serve
.PHONY: build
build: hugo
.PHONY: check-links
check-links: hugo
lychee content/
.PHONY: test
test: check-links ## Runs test, check links
.PHONY: deploy-main
deploy-main: build # test temporarily removed
rsync $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST)/ -ravz --delete
.PHONY: deploy-staging
deploy-staging: DOMAIN = staging.earnestma.com
deploy-staging: build test ## Build the website and deploy it to staging
rsync $(OUTPUT_DIR)/ $(WWW_RSYNC_DEST)/ -ravz --delete
.PHONY: help
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: all
all: deploy-main ## Build the website and deploy it