ci: compress deploy artifact to speed up ssh publish

This commit is contained in:
root
2026-03-10 00:34:20 +08:00
parent df4fc36819
commit be5a1bcdd1
2 changed files with 20 additions and 5 deletions
+13
View File
@@ -97,6 +97,19 @@ if [ ! -f "$SOURCE_BIN" ]; then
exit 1
fi
if [[ "$SOURCE_BIN" == *.gz ]]; then
if ! command -v gzip >/dev/null 2>&1; then
echo "gzip not found on server" >&2
exit 1
fi
decompressed_bin="${SOURCE_BIN%.gz}"
log "decompressing binary: ${SOURCE_BIN} -> ${decompressed_bin}"
gzip -dc "$SOURCE_BIN" > "$decompressed_bin"
chmod 755 "$decompressed_bin"
rm -f "$SOURCE_BIN"
SOURCE_BIN="$decompressed_bin"
fi
log "deploy start, release: ${RELEASE_ID}"
mkdir -p "$DIST_DIR" "$APP_DIR/backups"