mykiwi/mykiwi.blogpublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Makefile · 46 lines · 1.7 KBMakefile Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.DEFAULT_GOAL := help

# CLOUDFLARE_API_TOKEN lives in .env (gitignored, copy from .env.dist) -
# load it into every recipe's environment, e.g. for infra-plan/infra-apply/deploy.
ifneq (,$(wildcard .env))
include .env
export
endif

# languages.txt is the single source of truth for the site's language set,
# shared with infra/main.tf - blog/hugo.toml's [languages.*] blocks are the
# one place it can't drive directly (Tofu has no TOML parser), so keep those
# in sync by hand.
LANGS := $(shell cat languages.txt)

# deploy-% targets aren't listed here: giving an instantiated pattern target
# (e.g. deploy-en) to .PHONY creates an explicit no-recipe rule for it, which
# then blocks the deploy-% pattern rule below from ever supplying a recipe.
.PHONY: help dev build serve infra-plan infra-apply deploy clean

help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "  \033[36m%-14s\033[0m %s\n", $$1, $$2}'

dev: ## Drop into the Hugo dev shell (hugo, dart-sass)
	nix develop

build: ## Build the site (all languages) into ./result
	nix build

serve: ## Run the Hugo dev server with live reload
	nix develop --command hugo server --source blog

infra-plan: ## Show what infra-apply would change on Cloudflare
	nix run .#infra -- plan

infra-apply: ## Apply infra/ changes to Cloudflare
	nix run .#infra -- apply

deploy: build ## Build the site and push it to Cloudflare Pages (all languages, in parallel)
	$(MAKE) --no-print-directory --output-sync=target -j$(words $(LANGS)) $(addprefix deploy-,$(LANGS))

deploy-%: ## Deploy a single language to Cloudflare Pages, e.g. `make deploy-en` (assumes `make build` already ran)
	nix run .#deploy -- $*

clean: ## Remove build outputs
	rm -rf result blog/public blog/resources