test
All checks were successful
Build and Push Teamspeak Images on Base Image Update / check-for-changes (push) Successful in 10s
Build and Push Teamspeak Images on Base Image Update / build-alpine (push) Has been skipped
Build and Push Teamspeak Images on Base Image Update / build-debian (push) Has been skipped
Build and Push Teamspeak Images on Base Image Update / build-basic (push) Has been skipped
Build and Push Teamspeak Images on Base Image Update / generate-build-info (push) Has been skipped
Build and Push Teamspeak Images on Base Image Update / generate-changelogs (push) Has been skipped
All checks were successful
Build and Push Teamspeak Images on Base Image Update / check-for-changes (push) Successful in 10s
Build and Push Teamspeak Images on Base Image Update / build-alpine (push) Has been skipped
Build and Push Teamspeak Images on Base Image Update / build-debian (push) Has been skipped
Build and Push Teamspeak Images on Base Image Update / build-basic (push) Has been skipped
Build and Push Teamspeak Images on Base Image Update / generate-build-info (push) Has been skipped
Build and Push Teamspeak Images on Base Image Update / generate-changelogs (push) Has been skipped
This commit is contained in:
@@ -49,11 +49,7 @@ jobs:
|
||||
run: |
|
||||
alpine_digest=$(docker inspect --format='{{index .RepoDigests 0}}' alpine:latest || echo "unknown")
|
||||
debian_digest=$(docker inspect --format='{{index .RepoDigests 0}}' gitea.fithwum.tech/${{ secrets.GIT_USERNAME }}/debian-base:bookworm || echo "unknown")
|
||||
basic_digest=$debian_digest # assuming basic uses same debian-base image
|
||||
|
||||
echo "$alpine_digest" > .cache/alpine-base.digest
|
||||
echo "$debian_digest" > .cache/debian-base.digest
|
||||
echo "$basic_digest" > .cache/basic-base.digest
|
||||
basic_digest=$debian_digest # basic uses debian-base
|
||||
|
||||
echo "alpine_digest=$alpine_digest" >> $GITHUB_OUTPUT
|
||||
echo "debian_digest=$debian_digest" >> $GITHUB_OUTPUT
|
||||
@@ -64,24 +60,31 @@ jobs:
|
||||
git config user.name "${{ secrets.GIT_USERNAME }}"
|
||||
git config user.email "${{ secrets.GIT_EMAIL }}"
|
||||
|
||||
changes=false
|
||||
for file in .cache/*-base.digest; do
|
||||
if git diff --quiet "$file"; then
|
||||
echo "[INFO] No changes in $file"
|
||||
else
|
||||
echo "[INFO] Changes detected in $file"
|
||||
changes=true
|
||||
fi
|
||||
done
|
||||
changed=false
|
||||
|
||||
if [ "$changes" = true ]; then
|
||||
# Stash local changes before rebasing
|
||||
git stash push -m "temp-stash-before-rebase"
|
||||
check_and_update() {
|
||||
name="$1"
|
||||
digest="$2"
|
||||
file=".cache/${name}-base.digest"
|
||||
if [[ ! -f "$file" ]] || [[ "$(cat "$file")" != "$digest" ]]; then
|
||||
echo "$digest" > "$file"
|
||||
echo "[INFO] $name digest changed"
|
||||
changed=true
|
||||
else
|
||||
echo "[INFO] $name digest unchanged"
|
||||
fi
|
||||
}
|
||||
|
||||
check_and_update alpine "${{ steps.get_digest.outputs.alpine_digest }}"
|
||||
check_and_update debian "${{ steps.get_digest.outputs.debian_digest }}"
|
||||
check_and_update basic "${{ steps.get_digest.outputs.basic_digest }}"
|
||||
|
||||
if [ "$changed" = true ]; then
|
||||
git stash push --include-untracked -m "temp-stash-before-rebase"
|
||||
git fetch origin main
|
||||
git rebase origin/main
|
||||
git stash pop || true
|
||||
|
||||
# Now re-check and commit the changes
|
||||
git add .cache/*-base.digest
|
||||
git commit -m "Update base image digests ($(date -u +'%Y-%m-%dT%H:%M:%SZ'))"
|
||||
git push origin HEAD:main
|
||||
|
||||
Reference in New Issue
Block a user