Last active
June 22, 2024 18:46
-
-
Save AlbertVeli/321ead4bfc2226afb057a2bd16313e50 to your computer and use it in GitHub Desktop.
Deploy Makefile 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by ChatGPT 4.0o, untested | |
SRC_DIR := . | |
BUILD_DIR := public_html | |
DEST_DIR := /path/to/production | |
SERVER := user@production-server.com | |
MD_FILES := $(wildcard $(SRC_DIR)/*.md) | |
HTML_FILES := $(MD_FILES:$(SRC_DIR)/%.md=$(BUILD_DIR)/%.html) | |
# Rule to convert markdown to HTML | |
$(BUILD_DIR)/%.html: $(SRC_DIR)/%.md | |
mkdir -p $(BUILD_DIR) | |
# You can try some other markdown to html converter | |
# if pandoc isn't good enough. GitHub uses cmark-gfm. | |
pandoc $< -o $@ | |
deploy: $(HTML_FILES) | |
scp $(HTML_FILES) $(SERVER):$(DEST_DIR) | |
.PHONY: deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment