Update 2024.11.18 15:44:15 CET

This commit is contained in:
Phil Bajsicki 2024-11-18 15:44:17 +01:00
parent 0e3a24ab77
commit 288a6e97e9
2 changed files with 7 additions and 23 deletions

View file

@ -13,7 +13,7 @@ The post-receive hook is like so:
#+begin_src sh
#!/bin/bash
# Directory on the server where the website will be mapped.
export GIT_WORK_TREE=/srv/bajsicki.com
export GIT_WORK_TREE=/srv/bajsicki.com/
echo `pwd`
echo "post-receive: Generating https://bajsicki.com with Hugo..."
@ -24,27 +24,18 @@ chmod 755 $GIT_WORK_TREE
# Remove any files already in the public directory, a fresh copy will be generated by hugo
rm -rf $GIT_WORK_TREE/public
# Update the modules in case of changes and pull the new pages
cd $GIT_WORK_TREE && git pull --recurse-submodules
# Generate the site with hugo
cd $GIT_WORK_TREE && chmod +x update.sh
cd $GIT_WORK_TREE && ./update.sh
cd $GIT_WORK_TREE && hugo
# Fix any permission problems.
find $GIT_WORK_TREE/public -type f -print | xargs -d '\n' chmod 644
find $GIT_WORK_TREE/public -type d -print | xargs -d '\n' chmod 755
echo "post-receive: Hugo site generation complete"
#+end_src
The ~update.sh~ script is as dead simple as things get.
#+begin_src sh
#!/usr/bin/env sh
cd themes/hugo-tufte/
git reset --hard && git pull origin main -f
cd ../..
git reset --hard && git pull origin main -f
hugo
echo "post-receive: Hugo site deployment complete"
#+end_src

View file

@ -1,7 +0,0 @@
#!/usr/bin/env sh
cd themes/hugo-tufte/
git reset --hard && git pull origin main -f
cd ../..
git reset --hard && git pull origin main -f
hugo