Web2Comics

Web2Comic Bot Deployment Runbook

Cross references:

Scope note:

Public Command Surface (For Deployment Validation)

Scope

This runbook covers deployment of the Telegram webhook bot in telegram/src/webhook-bot.js with persistent storage in Cloudflare R2.

1) Prerequisites

2) Required Secrets

Set these in GitHub Secrets (recommended) or local env for manual deployment.

3) Secret Validation

Validate mapping and required env values before deploy:

npm run secrets:validate:deploy
npm run secrets:validate:deploy:ci

Audit GitHub repo plus environment secrets before dispatching the workflow:

npm run secrets:validate:deploy:github:staging
npm run secrets:validate:deploy:github:production

Predeploy also enforces strict Cloudflare token roles:

CI workflows also enforce these checks:

4) Deploy Commands

Primary path:

npm run bot:deploy:auto -- --target render --env staging --branch stage1 --env-only

Useful variants:

npm run bot:deploy:auto -- --target render --env staging --branch stage1 --env-only --with-render-smoke
npm run bot:deploy:auto -- --target cloudflare --env-only --with-cloudflare-smoke
npm run bot:deploy:auto -- --target both --env staging --branch stage1 --env-only --with-render-smoke --with-cloudflare-smoke

By default, bot:deploy:auto now runs a post-deploy sanity E2E check for Render (telegram/scripts/postdeploy-sanity.js). Skip it only when needed:

npm run bot:deploy:auto -- --target render --env staging --branch stage1 --env-only --skip-sanity

5) What Automation Performs

Sanity Probe Behavior

6) Post-Deploy Checks

7) Rollback/Hotfix