mykiwi/mykiwi.blogpublic Fork 0
47c5f424525f98bea38b29cd0aaa77accb2a704b
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 · 42 lines · 1.5 KBMakefile Blame HistoryRaw
Add Cloudflare provisioning and deploy tooling e4c5d34 Romain Gautier 13h ago1.DEFAULT_GOAL := help
2
3# CLOUDFLARE_API_TOKEN lives in .env (gitignored, copy from .env.dist) -
4# load it into every recipe's environment, e.g. for infra-plan/infra-apply/deploy.
5ifneq (,$(wildcard .env))
6include .env
7export
8endif
9
Parallelize make deploy across languages 47c5f42 Romain Gautier 7h ago10LANGS := en fr pt ja es
11
12# deploy-% targets aren't listed here: giving an instantiated pattern target
13# (e.g. deploy-en) to .PHONY creates an explicit no-recipe rule for it, which
14# then blocks the deploy-% pattern rule below from ever supplying a recipe.
Add Cloudflare provisioning and deploy tooling e4c5d34 Romain Gautier 13h ago15.PHONY: help dev build serve infra-plan infra-apply deploy clean
16
17help:
18 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
19
20dev: ## Drop into the Hugo dev shell (hugo, dart-sass)
21 nix develop
22
23build: ## Build the site (all languages) into ./result
24 nix build
25
26serve: ## Run the Hugo dev server with live reload
Fix make serve to point Hugo at blog/ a74fe0a Romain Gautier 9h ago27 nix develop --command hugo server --source blog
Add Cloudflare provisioning and deploy tooling e4c5d34 Romain Gautier 13h ago28
29infra-plan: ## Show what infra-apply would change on Cloudflare
30 nix run .#infra -- plan
31
32infra-apply: ## Apply infra/ changes to Cloudflare
33 nix run .#infra -- apply
34
Parallelize make deploy across languages 47c5f42 Romain Gautier 7h ago35deploy: build ## Build the site and push it to Cloudflare Pages (all languages, in parallel)
36 $(MAKE) --no-print-directory --output-sync=target -j$(words $(LANGS)) $(addprefix deploy-,$(LANGS))
37
38deploy-%: ## Deploy a single language to Cloudflare Pages, e.g. `make deploy-en` (assumes `make build` already ran)
39 nix run .#deploy -- $*
Add Cloudflare provisioning and deploy tooling e4c5d34 Romain Gautier 13h ago40
41clean: ## Remove build outputs
42 rm -rf result blog/public blog/resources