From 015a664893564d0313c98735d7cefaeef74eadbf Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Fri, 13 Feb 2026 07:07:49 -0700 Subject: [PATCH] Add production deployment targets to Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit make deploy — full pipeline (push, pull, rebuild) make deploy-status / deploy-logs for monitoring --- site/Makefile | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/site/Makefile b/site/Makefile index abf390d..07356af 100644 --- a/site/Makefile +++ b/site/Makefile @@ -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"