Add Gitea Actions registry publish workflow and Unraid auto-update script
Build and Publish Docker Image / test-and-publish (push) Failing after 2m25s
Build and Publish Docker Image / test-and-publish (push) Failing after 2m25s
This commit is contained in:
1 parent
84b08f0cdb
commit
18c492488c
5 files changed
+90
-1
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Schedule this in Unraid's "User Scripts" plugin (e.g. every 15 minutes)
|
||||
# to automatically pull & rebuild whenever you push updates to Gitea.
|
||||
|
||||
APP_DIR="/mnt/user/appdata/professor-oak-tracker"
|
||||
BRANCH="main"
|
||||
|
||||
cd "${APP_DIR}"
|
||||
git fetch origin "${BRANCH}" --quiet
|
||||
|
||||
LOCAL_SHA="$(git rev-parse HEAD)"
|
||||
REMOTE_SHA="$(git rev-parse "origin/${BRANCH}")"
|
||||
|
||||
if [ "${LOCAL_SHA}" != "${REMOTE_SHA}" ]; then
|
||||
echo "[oaktracker] Update detected (${LOCAL_SHA:0:7} -> ${REMOTE_SHA:0:7}), rebuilding container..."
|
||||
git pull --ff-only origin "${BRANCH}"
|
||||
docker compose up -d --build
|
||||
docker image prune -f >/dev/null 2>&1 || true
|
||||
echo "[oaktracker] Updated cleanly to ${REMOTE_SHA:0:7}."
|
||||
fi
|
||||
Reference in new issue
Block a user