blog/deploy.sh
Matthew Binning f4f77a6070
Some checks failed
CI / build (push) Failing after 3s
CI / deploy (push) Failing after 3m1s
feat!: Separate www into www/blog and www/private
Now the private content is stored as a git submodule.
This means I can keep that repo's source private, but still use it in
the build product.
The build product (website) relies on HTTP basic authentication, so
access control is maintained throughout the SDLC.
2026-04-04 13:12:10 -07:00

22 lines
No EOL
877 B
Bash
Executable file

#!/usr/bin/env sh
set -e
printf "Deploying to PRODUCTION environment...\n"
REMOTE_HOST="crossbox"
REMOTE_USER="brimlock"
REMOTE_PATH="/srv/www/binning.net"
if ! ssh -o BatchMode=yes -o ConnectTimeout=5 ${REMOTE_USER}@${REMOTE_HOST} exit 2>/dev/null; then
printf "Warning: SSH connection test failed. Ensure SSH keys are configured.\nYou may be prompted for a password.\n"
fi
printf "Deploying website files...\n"
ssh ${REMOTE_USER}@${REMOTE_HOST} "mkdir -p /tmp/blog-deploy"
rsync -avz --delete blog/ ${REMOTE_USER}@${REMOTE_HOST}:/tmp/blog-deploy/
ssh ${REMOTE_USER}@${REMOTE_HOST} "sudo rsync -avz --delete /tmp/blog-deploy/ ${REMOTE_PATH}/ && \
sudo chown -R nginx:nginx ${REMOTE_PATH}/ && \
printf 'Content deployed.\n'"
printf "✓ Production deployment complete!\n\nNginx configuration is managed by the nixos-config flake (hosts/crossbox/nginx.nix).\n"