This repository has been archived on 2021-03-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
blog/deploy
2020-12-03 13:29:38 +01:00

21 lines
429 B
Bash
Executable file

#!/usr/bin/env sh
# Generate the new files
hugo
# Compress them into a ball
tar -czf public.tar.gz public
# Copy tarball to server
scp -P $RUBY_PORT public.tar.gz $RUBY_USER@$RUBY_URL:/srv/nginx/sites/
# Unpack the tarball
ssh -p $RUBY_PORT $RUBY_USER@$RUBY_URL bash << EOF
cd /srv/nginx/sites/ && tar -xf public.tar.gz && \\
rm -rf blog && \\
mv public blog && \\
rm public.tar.gz
EOF
# Delete the tarball
rm public.tar.gz