Skip to content

Instantly share code, notes, and snippets.

@jackbaty
Created June 30, 2023 10:35
Show Gist options
  • Save jackbaty/b89aa74ef015797780936555e51643b7 to your computer and use it in GitHub Desktop.
Save jackbaty/b89aa74ef015797780936555e51643b7 to your computer and use it in GitHub Desktop.
Makefile for deploying baty.net
SERVER_HOST=servername.baty.net
SERVER_DIR=/home/jbaty/apps/baty.net/public_html
PUBLIC_DIR=/Users/jbaty/sites/blog/public/
TARGET=DigitalOcean
.POSIX:
.PHONY: build checkpoint deploy
# search index. No longer used.
# npx -y pagefind --source public
build:
rm -rf $(PUBLIC_DIR)
hugo --gc --minify
checkpoint:
git add .
git diff-index --quiet HEAD || git commit -m "Publish checkpoint"
deploy: build checkpoint
git push
@echo "\033[0;32mDeploying updates to $(TARGET)...\033[0m"
rsync -v -rz --checksum --delete --no-perms $(PUBLIC_DIR) $(SERVER_HOST):$(SERVER_DIR)
open raycast://confetti
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment