Relates-to: [EM-1] Reviewed-on: #27 Closes: #26main
parent
27948c0e68
commit
ef1707841a
@ -0,0 +1,43 @@
|
||||
domain := "earnestma.com"
|
||||
hugo_baseurl := "https://" + domain + "/"
|
||||
staging_url := "https://staging.earnestma.com/"
|
||||
staging_location := "earne@staging.earnestma.com:staging.earnestma.com"
|
||||
user := "earne@" + domain
|
||||
www_root := "/home/earne/" + domain
|
||||
www_rsync_dest := user + ":" + www_root
|
||||
output_dir := "public"
|
||||
|
||||
# build and deploy
|
||||
default: deploy-main
|
||||
|
||||
# show this help (just --list)
|
||||
help:
|
||||
just --list
|
||||
|
||||
# remove output files
|
||||
clean:
|
||||
rm -rf {{ output_dir }}
|
||||
rm -rf static/recipes.yaml
|
||||
|
||||
# build the site
|
||||
build site=hugo_baseurl +flags='--gc': clean
|
||||
cp data/recipes.yaml static/recipes.yaml
|
||||
hugo -b {{ site }} {{ flags }}
|
||||
|
||||
# deploy
|
||||
deploy-main: build
|
||||
rsync {{ output_dir }}/ {{ www_rsync_dest }} -ravz --delete
|
||||
|
||||
# staging deploy
|
||||
deploy-staging: (build staging_url)
|
||||
rsync {{ output_dir }}/ {{ staging_location }} -ravz --delete
|
||||
|
||||
# serve
|
||||
serve:
|
||||
hugo serve
|
||||
|
||||
# run tests
|
||||
test: build _test_check-links
|
||||
|
||||
_test_check-links:
|
||||
lychee content/
|
@ -1,49 +0,0 @@
|
||||
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
|
Loading…
Reference in new issue