My personal website and blog
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

HUGO_FLAGS += --gc
USER = earne@$(DOMAIN)
WWW_ROOT = /home/earne/$(DOMAIN)
OUTPUT_DIR = public
.PHONY: hugo
hugo: clean
cp data/recipes.yaml static/recipes.yaml
.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 =
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