feat: Add a recipe book
Created a recipe section in the blog from existing markdown content.
This commit is contained in:
parent
5b25211618
commit
d2421d41f3
5 changed files with 172 additions and 71 deletions
38
deploy.sh
38
deploy.sh
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
set -e
|
||||
|
||||
# Common files to deploy (shared between staging and prod)
|
||||
DEPLOY_FILES="blog includes index.html blog.html resume.html style.css 404.html"
|
||||
|
||||
# Usage information
|
||||
usage() {
|
||||
printf "Usage: %s [staging|prod]\n\n staging - Deploy to local staging environment (/srv/www/stage.binning.net)\n prod - Deploy to production server via SSH (www.binning.net)\n\nExample:\n %s staging\n %s prod\n" "$0" "$0" "$0"
|
||||
|
|
@ -27,15 +30,7 @@ case $ENV in
|
|||
|
||||
# Deploy website files via rsync
|
||||
printf "Deploying website files...\n"
|
||||
sudo rsync -av --delete \
|
||||
blog \
|
||||
includes \
|
||||
index.html \
|
||||
blog.html \
|
||||
resume.html \
|
||||
style.css \
|
||||
404.html \
|
||||
${STAGING_PATH}/
|
||||
sudo rsync -av --delete ${DEPLOY_FILES} ${STAGING_PATH}/
|
||||
|
||||
# Set proper ownership
|
||||
sudo chown -R nginx:nginx ${STAGING_PATH}/
|
||||
|
|
@ -50,8 +45,8 @@ case $ENV in
|
|||
printf "Deploying to PRODUCTION environment...\n"
|
||||
|
||||
# SSH details
|
||||
REMOTE_HOST="binning.net"
|
||||
REMOTE_USER="matthew.binning"
|
||||
REMOTE_HOST="crossbox"
|
||||
REMOTE_USER="m3b"
|
||||
REMOTE_PATH="/srv/www/binning.net"
|
||||
REMOTE_NIXOS="/etc/nixos/"
|
||||
|
||||
|
|
@ -61,24 +56,21 @@ case $ENV in
|
|||
fi
|
||||
|
||||
# Deploy website files via rsync over SSH
|
||||
# Using just the host from SSH config without user@ prefix
|
||||
printf "Deploying website files...\n"
|
||||
rsync -avz --delete \
|
||||
-e ssh \
|
||||
blog \
|
||||
includes \
|
||||
index.html \
|
||||
blog.html \
|
||||
resume.html \
|
||||
style.css \
|
||||
404.html \
|
||||
${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_PATH}/
|
||||
ssh ${REMOTE_HOST} "mkdir -p /tmp/${REMOTE_PATH}"
|
||||
rsync -avz --delete ${DEPLOY_FILES} ${REMOTE_HOST}:/tmp/${REMOTE_PATH}/
|
||||
# Set proper permissions and move config on remote server
|
||||
ssh ${REMOTE_HOST} "sudo mv /tmp/${REMOTE_PATH} ${REMOTE_PATH} && \
|
||||
sudo chown -R nginx:nginx ${REMOTE_PATH}/ && \
|
||||
printf 'Content deployed.\n'"
|
||||
|
||||
# Deploy nginx configuration
|
||||
printf "Deploying nginx configuration...\n"
|
||||
scp prod.nginx.nix ${REMOTE_USER}@${REMOTE_HOST}:/tmp/nginx.nix
|
||||
scp prod.nginx.nix ${REMOTE_HOST}:/tmp/nginx.nix
|
||||
|
||||
# Set proper permissions and move config on remote server
|
||||
ssh ${REMOTE_USER}@${REMOTE_HOST} "sudo mv /tmp/nginx.nix ${REMOTE_NIXOS}nginx.nix && \
|
||||
ssh ${REMOTE_HOST} "sudo mv /tmp/nginx.nix ${REMOTE_NIXOS}nginx.nix && \
|
||||
sudo chown -R nginx:nginx ${REMOTE_PATH}/ && \
|
||||
printf 'Configuration deployed. Run sudo nixos-rebuild switch to activate.\n'"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue