From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail-a.sr.ht; dkim=pass header.d=johnnyrichard.com header.i=@johnnyrichard.com Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [IPv6:2001:41d0:1004:224b::bd]) by mail-a.sr.ht (Postfix) with ESMTPS id 3BB22200B2 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 17 Feb 2024 19:25:30 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1708197928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DzthdHwY5bR4A1sT3LteXhJALJ1jWcfHBgbG1LhDZl0=; b=Lxc7CPWFcBmStcXu2JuFQc9LP5iNBmUSE21cBNpLljEz7232LcPwVfrcucEZ3mIfwTj88r UD1DYssoGv3Kaf7GD38454YP3svF/xIXAQX+iK1NwwXNwxRFk27fD54w6GACxw+AMRsSOe VzUTRDnZlJqwhB2544b5uHjyDzeY+xv6OxkisaD8nH/RZSCGen7I0+C5y3CiV21BBjznrY XIruOg46GEwkDvi3/a9FNpmmsG9I2xIsFMW2kV/xQfZJ9NED0KOTtwK2iGYLLkN5B7EiS5 iV0rZPa57o1O3mAmmGDi9kDdDskmiFioa1XFZJRDxgooDcmh2jaBXq/6accxDw== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard Subject: [PATCH olang] docs: build: deploy site on push event Date: Sat, 17 Feb 2024 21:27:12 +0100 Message-ID: <20240217202714.94103-2-johnny@johnnyrichard.com> MIME-Version: 1.0 X-Sourcehut-Patchset-Update: APPLIED Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-TUID: Z47n9ZRvdL62 Signed-off-by: Johnny Richard --- This patch is already applied: To git.sr.ht:~johnnyrichard/olang 4c8374d...892b6b9 main -> main .build.yml | 9 +++++++++ .gitignore | 1 + Makefile | 8 ++++++++ docs/Makefile | 10 +++++++++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.build.yml b/.build.yml index b38efb3..42c5510 100644 --- a/.build.yml +++ b/.build.yml @@ -1,8 +1,13 @@ image: archlinux +oauth: pages.sr.ht/PAGES:RW packages: - gcc - make + - hut - clang + - pandoc-cli +environment: + site: johnnyrichard.srht.site sources: - https://git.sr.ht/~johnnyrichard/olang tasks: @@ -12,7 +17,11 @@ tasks: - build: | cd olang make + make docs-dist - check: | cd olang make check + - docs-publish: | + cd olang + [ -z "$BUILD_REASON" ] && hut pages publish -d $site docs/site.tar.gz diff --git a/.gitignore b/.gitignore index b140d08..fe64668 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ 0c build *.o +docs/site.tar.gz diff --git a/Makefile b/Makefile index b13b41b..bbc73dd 100644 --- a/Makefile +++ b/Makefile @@ -36,5 +36,13 @@ integration-test: check: $(MAKE) integration-test +.PHONY: docs +docs: + $(MAKE) -C docs + +.PHONY: docs-dist +docs-dist: + $(MAKE) -C docs dist + $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c $(CC) $(CFLAGS) -c $< -o $@ diff --git a/docs/Makefile b/docs/Makefile index e5b7154..ecb51a2 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,6 +2,7 @@ PANDOC := pandoc INDEX := index.md BUILD_DIR := build TARGET := $(BUILD_DIR)/index.html +DIST_FILE := site.tar.gz PAGES_DIR := pages PAGES := $(wildcard $(PAGES_DIR)/*.md) HTML_PAGES := $(patsubst $(PAGES_DIR)/%.md, $(BUILD_DIR)/$(PAGES_DIR)/%.html, $(PAGES)) @@ -11,7 +12,14 @@ all: $(BUILD_DIR) $(TARGET) $(PAGES) .PHONY: clean clean: - rm -rf build/ + rm -rf $(BUILD_DIR) + rm -f $(DIST_FILE) + +.PHONY: dist +dist: $(DIST_FILE) + +$(DIST_FILE): all + tar -czf $(DIST_FILE) -C $(BUILD_DIR) . $(TARGET): $(HTML_PAGES) $(PANDOC) -s --template template.html -f markdown -t html $(INDEX) > $(TARGET) -- 2.43.2