Update .gitea/workflows/sync-public.yml
Sync public mirror / sync (push) Successful in 1m1s

This commit is contained in:
2025-10-06 21:35:14 +02:00
parent 83e30d2c3d
commit 25b8024bf5
+9 -9
View File
@@ -2,7 +2,7 @@ name: Sync public mirror
on: on:
push: push:
branches: [ main ] # change if your default branch is different branches: [ main ]
jobs: jobs:
sync: sync:
@@ -43,10 +43,10 @@ jobs:
echo "Generating rsync include list from $KEEP_FILE" echo "Generating rsync include list from $KEEP_FILE"
: > "$INCLUDE_FILE" : > "$INCLUDE_FILE"
echo "## Generated from $KEEP_FILE" >> "$INCLUDE_FILE" echo "## Generated from $KEEP_FILE" >> "$INCLUDE_FILE"
echo "+ */" >> "$INCLUDE_FILE" # allow directory traversal echo "+ */" >> "$INCLUDE_FILE"
while IFS= read -r line; do while IFS= read -r line; do
line="${line%%#*}" # strip comments line="${line%%#*}"
line="$(echo "$line" | xargs || true)" line="$(echo "$line" | xargs || true)"
[ -z "$line" ] && continue [ -z "$line" ] && continue
case "$line" in case "$line" in
@@ -60,25 +60,25 @@ jobs:
esac esac
done < "$KEEP_FILE" done < "$KEEP_FILE"
echo "- *" >> "$INCLUDE_FILE" # exclude everything else echo "- *" >> "$INCLUDE_FILE"
echo "Rsync include rules:" echo "Rsync include rules:"
cat "$INCLUDE_FILE" cat "$INCLUDE_FILE"
# Sync only allowed files to the public repo echo "Syncing files to /tmp/public"
rsync -a --delete --prune-empty-dirs \ rsync -a --delete --prune-empty-dirs \
--exclude '.git/' \
--include-from="$INCLUDE_FILE" \ --include-from="$INCLUDE_FILE" \
./ /tmp/public/ ./ /tmp/public/
cd /tmp/public cd /tmp/public
git config user.name "Gitea CI" git config user.name "Gitea CI"
git config user.email "ci@bausager.org" git config user.email "ci@bausager.org"
git add -A git add -A
if git diff --cached --quiet; then if git diff --cached --quiet; then
echo "No public-eligible changes to push." echo "No public-eligible changes to push."
else else
echo "Pushing filtered subset to Flux-oss..." echo "🚀 Pushing filtered subset to Flux-oss..."
git commit -m "Sync public subset from Flux (private)" git commit -m "Sync public subset from Flux (private)"
git push origin HEAD:main git push origin HEAD:main
fi fi