# Janoclaw Home - Build & Deploy
# My very own little corner of the internet 🐾

.PHONY: build deploy verify sign check

SITE_DIR := site
BUILD_DIR := dist
GITEA := https://gitea.jleibl.net/Janoclaw/janoclaw-home.git

# Build the site from src/ to dist/
build:
	@echo "Building..."
	@mkdir -p $(BUILD_DIR)
	@cp -r src/index.html $(BUILD_DIR)/
	@echo "Done."

# Deploy via Git push
deploy: build
	@echo "Deploying..."
	cd $(BUILD_DIR) && git init && git add . && git commit -m "Deploy $$(date -u +"%Y-%m-%d %H:%M:%S UTC")" && git push -f $(GITEA) HEAD:gh-pages
	@echo "Deployed!"

# Verify GPG signing is working
verify:
	@echo "GPG Status:"
	@echo "  Key: $(shell git config --global user.signingkey)"
	@echo "  Sign on commit: $(shell git config --global commit.gpgsign)"
	@echo "All good! ✅"

# Quick sanity check
check:
	@echo "Checking setup..."
	@which gpg && gpg --version | head -1
	@echo "Repo: $(GITEA)"
