Skip to content

Deployment

Jason Tucker edited this page Jun 5, 2026 · 2 revisions

Deployment

How deployments work

Every push to main triggers GitHub Actions to:

  1. Install deps + compile TypeScript (on the runner — never on VPS)
  2. Register slash commands
  3. Build Docker image → push to ghcr.io/jason-tucker/squishybot:latest
  4. SSH into VPS → pull new image → docker compose up -d
  5. Verify container is running
  6. Send Discord webhook notification

watchtower also runs on the VPS: the container carries the com.centurylinklabs.watchtower.enable="true" label, and watchtower polls the :latest tag (~30s) and restarts the bot when the digest changes. The SSH step above is a fast path, not the only deploy mechanism.

Required GitHub secrets

Set these in repo → Settings → Secrets and variables → Actions:

Secret Value
VPS_HOST VPS IP or hostname
VPS_USER botuser
VPS_SSH_KEY Private SSH key content
PROJECT_DIR /home/botuser/projects/squishybot
DISCORD_DEPLOY_WEBHOOK Discord webhook URL
DISCORD_BOT_TOKEN Bot token
DISCORD_CLIENT_ID Application ID
GUILD_ID Target guild ID

VPS management

squishybot status       # docker compose ps
squishybot logs         # live tail
squishybot tail 50      # last 50 lines
squishybot restart      # restart bot container
squishybot update       # git pull + image pull + restart
squishybot rebuild      # build image locally + restart
squishybot env          # edit .env and reload
squishybot db:shell     # psql into postgres

Install: sudo cp scripts/squishybot /usr/local/bin/squishybot && sudo chmod +x /usr/local/bin/squishybot

Rollback

# Find the SHA of the previous good deploy in GitHub Actions logs
BOT_IMAGE=ghcr.io/jason-tucker/squishybot:sha-abc1234 docker compose up -d

First-time VPS setup

See docs/DEPLOYMENT.md in the repo for the full setup guide: SSH key setup, CI secrets, schema push, rollback, and Unraid. (Deployment is Docker-only — there is no systemd service in the deploy path.)

Clone this wiki locally