Update deploy.sh

This commit is contained in:
Igor
2024-09-25 20:49:04 +02:00
committed by GitHub
parent e086979b28
commit 02f4cb5442

View File

@@ -63,6 +63,14 @@ if [[ -n "${OWNER}" && -n "${REPO}" ]]; then
PREFIX=repos
fi
# make swap file if not exists. useful for adhoc cloud runners
if [[ -z $(swapon --show=SIZE --raw --noheadings | sed 's/[^0-9]//g') ]]; then
sudo fallocate -l $(free -h | awk 'NR==2{print(int(substr($2,1,length($2)-1)/2+.5))}')G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
fi
# update OS and install dependencies
sudo apt-get -q update
[[ -z $(command -v xmllint) ]] && sudo apt-get -yy install libxml2-utils