Goodbye Hooks

Sep 25, 2024 @ 17:18 -0500

Hooks be Gone

When I first set this site up, I based how I set it up off what is now an increadibly old tutorial. Everytime I’ve done it since I’ve based my setup process off that. Well, times change. Gitea has git Hooks disabled by default now, and now so do I.

If not hooks, than what?

If I’m not publishing articles after writing them by doing a git push with the following autorun then how am I doing it?

#!/bin/bash

GIT_REPO=/redacted/tff.git
WORKING_DIRECTORY=$HOME/tffWorking
PUBLIC_WWW=/redacted/tff
BACKUP_WWW=$HOME/tffBackup
MY_DOMAIN=theflyingfool.com

set -e

rm -rf $WORKING_DIRECTORY
rsync -aqz $PUBLIC_WWW/ $BACKUP_WWW
trap "echo 'A problem occurred.  Reverting to backup.'; rsync -aqz --del $BACKUP_WWW/ $PUBLIC_WWW; rm -rf $WORKING_DIRECTORY" EXIT

git clone --recursive $GIT_REPO $WORKING_DIRECTORY
rm -rf $PUBLIC_WWW/*
/usr/bin/hugo -s $WORKING_DIRECTORY -d $PUBLIC_WWW -b "http://${MY_DOMAIN}"
rm -rf $WORKING_DIRECTORY
chmod -R 777 $PUBLIC_WWW
trap - EXIT

Well I moved on to Gitea Actions. Hopefully, with this change, I’ll start being more active in both updating this page and adding new content.

I do plan on putting up documentation for how to setup and use actions, and hopefully soon.