This commit is contained in:
@@ -2,7 +2,7 @@ name: Sync public mirror
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ] # change if your default branch is different
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
@@ -43,10 +43,10 @@ jobs:
|
||||
echo "Generating rsync include list 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
|
||||
line="${line%%#*}" # strip comments
|
||||
line="${line%%#*}"
|
||||
line="$(echo "$line" | xargs || true)"
|
||||
[ -z "$line" ] && continue
|
||||
case "$line" in
|
||||
@@ -60,25 +60,25 @@ jobs:
|
||||
esac
|
||||
done < "$KEEP_FILE"
|
||||
|
||||
echo "- *" >> "$INCLUDE_FILE" # exclude everything else
|
||||
|
||||
echo "- *" >> "$INCLUDE_FILE"
|
||||
echo "Rsync include rules:"
|
||||
cat "$INCLUDE_FILE"
|
||||
|
||||
# Sync only allowed files to the public repo
|
||||
echo "Syncing files to /tmp/public"
|
||||
rsync -a --delete --prune-empty-dirs \
|
||||
--exclude '.git/' \
|
||||
--include-from="$INCLUDE_FILE" \
|
||||
./ /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 add -A
|
||||
if git diff --cached --quiet; then
|
||||
echo "No public-eligible changes to push."
|
||||
echo "✅ No public-eligible changes to push."
|
||||
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 push origin HEAD:main
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user