Files
Esiah 858d862fed
deploy / deploy (push) Canceled after 0s
feat: init repo
2026-11-10 19:56:03 +01:00

18 lines
401 B
Bash

#!/bin/sh
set -eu
SRC="${1:-/app/dist}"
DEST="${2:-/output}"
REL="releases/$(date -u +%Y%m%dT%H%M%SZ)-$$"
KEEP=$(basename "$REL")
mkdir -p "$DEST/$REL"
cp -a "$SRC/." "$DEST/$REL/"
touch "$DEST/$REL"
ln -sfn "$REL" "$DEST/.current.tmp"
mv -T "$DEST/.current.tmp" "$DEST/current"
find "$DEST/releases" -mindepth 1 -maxdepth 1 -type d ! -name "$KEEP" -mmin +5 -exec rm -rf {} + 2>/dev/null || true