yoake/scripts/deploy.fish
2023-06-18 18:17:28 -05:00

25 lines
No EOL
601 B
Fish
Executable file

#!/usr/bin/env fish
echo "Building UI..."
cd ui && yarn build && cd .. \
|| exit 1
echo "Building server..."
cargo build --release \
|| exit 1
echo "Copying files..."
scp target/release/yoake_server config-prod.yaml yoake: \
|| exit 1
echo "Deploying..."
ssh yoake "
echo 'Stopping server...'
sudo systemctl stop yoake-server
sudo mv yoake_server /var/lib/caddy/yoake/
sudo mv config-prod.yaml /var/lib/caddy/yoake/config.yaml
sudo chown -R caddy:caddy /var/lib/caddy/yoake/
echo 'Starting server...'
sudo systemctl start yoake-server
" \
|| exit 1