Skip to the content.

Auto-deploy with GitHub Actions

← Back to README

Four workflows live in .github/workflows/:

Required GitHub Secrets

Secret Description
VPS_HOST IP address or hostname of your VPS
VPS_USER SSH username (e.g. deploy)
VPS_SSH_KEY SSH private key (full contents of ~/.ssh/id_ed25519)
TELEGRAM_BOT_TOKEN Telegram bot token
TELEGRAM_CHAT_ID Chat ID where the bot listens
ANTHROPIC_API_KEY Anthropic API key

Optional secrets mirror the .env variables — see .env.example for the full list.

CLAUDE_EXTRA_INSTRUCTIONS (additional rules for the agent — not actually a secret) can be set as either a GitHub Actions Variable (Settings → Secrets and variables → Actions → Variables tab) or a Secret. Variables are preferred: they’re visible in plain text in the UI, easy to inspect and edit, and not masked in logs. The deploy workflow reads vars.CLAUDE_EXTRA_INSTRUCTIONS first and falls back to secrets.CLAUDE_EXTRA_INSTRUCTIONS.

To trigger a deploy without a code push: Actions > Deploy > Run workflow.

What persists between deploys

Path Contents
./vault/ Obsidian notes — gitignored, untouched by deploy
./takopi-state/ Takopi session data — gitignored
./obsidian-state/ Obsidian Sync auth — gitignored

Setting up SSH access for CI

Generate a dedicated key for GitHub Actions on your local machine:

ssh-keygen -t ed25519 -C "github-actions-deploy" -f ~/.ssh/obsidian-deploy -N ""

Add the public key to the VPS:

ssh root@<VPS_IP> "mkdir -p ~/.ssh && chmod 700 ~/.ssh && \
  echo '$(cat ~/.ssh/obsidian-deploy.pub)' >> ~/.ssh/authorized_keys && \
  chmod 600 ~/.ssh/authorized_keys"

Copy the contents of ~/.ssh/obsidian-deploy (the private key, including BEGIN/END lines) into the VPS_SSH_KEY secret on GitHub.

Once secrets are set, trigger a manual deploy via Actions > Deploy > Run workflow to verify the connection. Subsequent pushes to main will deploy automatically.