From 4df556361db729da3f0f5f0cd5f1a11b8f32434a Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Wed, 11 Dec 2024 20:08:08 -0500 Subject: Build to tmp then replace live site, add build instructions to README --- README.md | 11 ++++++++++- post-receive | 7 +++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 97b8b43..6f6d724 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # website -Some random website + +It's my website's source code. Yay. + +## How to build + +You'll need Hugo and preferably a COW filesystem such as btrfs. +```sh +cp -r static public +hugo +``` diff --git a/post-receive b/post-receive index 15f816f..9276a99 100644 --- a/post-receive +++ b/post-receive @@ -11,6 +11,9 @@ cd $(git worktree list | grep master | cut -d' ' -f1) git submodule update # Manually copy static since btrfs COW is super fast +cp -r static /srv/http/tmp +hugo --destination /srv/http/tmp + +# Replace with new build rm -r /srv/http/www -cp -r static /srv/http/www -hugo --destination /srv/http/www +mv /srv/http/tmp /srv/http/www -- cgit v1.2.3-70-g09d2