Add production deployment targets to Makefile

make deploy — full pipeline (push, pull, rebuild)
make deploy-status / deploy-logs for monitoring
This commit is contained in:
Ryan Malloy 2026-02-13 07:07:49 -07:00
parent 6f3c203898
commit 015a664893

View File

@ -1,10 +1,10 @@
.PHONY: dev prod build up down logs clean
.PHONY: dev prod build up down logs clean local static deploy deploy-pull deploy-rebuild
# Development mode with hot reload
dev:
MODE=development DEV_MOUNT=./src docker compose up --build
# Production mode
# Production mode (local)
prod:
MODE=production docker compose up -d --build
@ -35,3 +35,34 @@ local:
# Build static site
static:
npm run build
# --- Production Deployment (forrest.warehack.ing) ---
# Remote: warehack.ing (149.28.126.25)
# User: warehack-ing (requires SSH agent forwarding for git pull)
# Path: /home/warehack-ing/forrest-mims-library/site
PROD_HOST = warehack-ing@warehack.ing
PROD_PATH = /home/warehack-ing/forrest-mims-library
# Full deploy: push, pull remote, rebuild container
deploy: deploy-push deploy-pull deploy-rebuild
# Push local commits to Gitea
deploy-push:
git push origin main
# Pull latest on production server
deploy-pull:
ssh -A $(PROD_HOST) "cd $(PROD_PATH) && git pull origin main"
# Rebuild and restart production container
deploy-rebuild:
ssh -A $(PROD_HOST) "cd $(PROD_PATH)/site && MODE=production docker compose up -d --build"
# Check production container status
deploy-status:
ssh $(PROD_HOST) "docker ps --filter name=mims-library --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'"
# View production logs
deploy-logs:
ssh $(PROD_HOST) "docker logs mims-library --tail 20"