| Add Cloudflare provisioning and deploy tooling e4c5d34 Romain Gautier 13h ago | 1 | .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. |
| 5 | ifneq (,$(wildcard .env)) |
| 6 | include .env |
| 7 | export |
| 8 | endif |
| 9 | |
| 10 | .PHONY: help dev build serve infra-plan infra-apply deploy clean |
| 11 | |
| 12 | help: |
| 13 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' |
| 14 | |
| 15 | dev: ## Drop into the Hugo dev shell (hugo, dart-sass) |
| 16 | nix develop |
| 17 | |
| 18 | build: ## Build the site (all languages) into ./result |
| 19 | nix build |
| 20 | |
| 21 | serve: ## Run the Hugo dev server with live reload |
| 22 | nix develop --command hugo server |
| 23 | |
| 24 | infra-plan: ## Show what infra-apply would change on Cloudflare |
| 25 | nix run .#infra -- plan |
| 26 | |
| 27 | infra-apply: ## Apply infra/ changes to Cloudflare |
| 28 | nix run .#infra -- apply |
| 29 | |
| 30 | deploy: ## Build the site and push it to Cloudflare Pages (all languages) |
| 31 | nix run .#deploy |
| 32 | |
| 33 | clean: ## Remove build outputs |
| 34 | rm -rf result blog/public blog/resources |