Gitea deploy
Some checks failed
Deploy / deploy (push) Failing after 4m25s

This commit is contained in:
David Eisinger
2026-04-08 22:37:59 -04:00
parent 0856d67d2d
commit 7a50a7541a
5 changed files with 117 additions and 11 deletions

41
bin/build Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
dither_dir="${repo_root}/bin/dither"
pushd "${dither_dir}" >/dev/null
bundle install
ROOT="${repo_root}/content" KEY="${repo_root}/secret.key" bundle exec rackup -p 4567 &
dither_pid=$!
popd >/dev/null
cleanup() {
if kill -0 "${dither_pid}" 2>/dev/null; then
kill "${dither_pid}" 2>/dev/null || true
wait "${dither_pid}" 2>/dev/null || true
fi
}
trap cleanup EXIT INT TERM
for _ in {1..50}; do
if (echo >/dev/tcp/localhost/4567) >/dev/null 2>&1; then
ready=1
break
fi
sleep 0.1
done
if [[ "${ready:-0}" -ne 1 ]]; then
echo "dither server did not start on port 4567" >&2
exit 1
fi
pushd "${repo_root}" >/dev/null
rm -rf public
HUGO_PARAMS_GIT_COMMIT="$(git rev-parse HEAD)" \
DITHER_SERVER=http://localhost:4567 \
hugo --minify
find public -name "*.enc" -type f -delete
find public/elsewhere -name "*.gmi" -type f -delete
popd >/dev/null