html-tower/.woodpecker/deploy.sh
oxaliq 0e49774d4f
Some checks failed
ci/woodpecker/push/pipeline Pipeline failed
add deployment script
2024-05-22 13:29:13 -04:00

21 lines
492 B
Bash

#!/bin/sh -e
host=root@oxaliq.net
targetdir=/var/www/art.oxaliq.net/html-tower
echo "COPYING FILES TO DEPLOYMENT TARGET"
scp -r src "$host":~/html-tower
echo "SETTING OWNERSHIP AND PERMISSIONS"
ssh $host 'chown -R www-data:www-data html-tower/'
ssh $host 'chown -R 755 html-tower'
echo "REPLACING PREVIOUS DEPLOYMENT"
ssh $host "rm -rf $targetdir || true"
ssh $host "mv html-tower $targetdir"
echo "RESTARTING SERVICE"
ssh $host 'systemctl restart nginx.service'
echo "SUCCESS!"
exit 0