Recipes
Deploy and Notify on Slack
Generate a report or artifact, deploy it with deplo.sh, and post the URL to a Slack channel automatically.
Combine deplo.sh with Slack's Incoming Webhooks to build fully automated reporting pipelines. Your team gets a fresh URL in Slack every time a report is generated — no manual steps.
The workflow
Data source → Generate artifact → deplo deploy → POST URL to SlackTypeScript example
import { DeploClient } from '@deplo/typescript-sdk';
const deplo = new DeploClient({ apiKey: process.env.DEPLO_KEY! });
const SLACK_WEBHOOK = process.env.SLACK_WEBHOOK_URL!;
// 1. Generate your report (HTML, PDF, JSON — anything)
const html = buildWeeklyReport(await fetchMetrics());
// 2. Deploy it
const { url } = await deplo.deploy({
project: 'weekly-report',
files: [{ path: 'index.html', content: html, encoding: 'utf8' }],
ttl: '14d',
});
// 3. Post to Slack
await fetch(SLACK_WEBHOOK, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: `📊 *Weekly Report is ready*\n<${url}|View Report>`,
},
},
{
type: 'context',
elements: [
{
type: 'mrkdwn',
text: `Generated ${new Date().toLocaleDateString()} · Expires in 14 days`,
},
],
},
],
}),
});
console.log('Report deployed and Slack notified.');With the CLI (bash script)
#!/bin/bash
# generate-and-notify.sh — run on cron
# Generate report
python generate_report.py > report.html
# Deploy
URL=$(deplo deploy report.html --project weekly-report --ttl 14d --json | jq -r '.url')
# Notify Slack
curl -X POST "$SLACK_WEBHOOK_URL" \
-H 'Content-Type: application/json' \
-d "{\"text\": \"📊 Weekly report is live: $URL\"}"Add to cron:
# Every Monday at 9am
0 9 * * 1 /path/to/generate-and-notify.shWith Claude Desktop (MCP)
Pull the latest metrics from our API, generate a dashboard report, deploy it, and post the URL to #team-reports on Slack.
Claude will chain the tools: fetch data → build HTML → deploy → send Slack message.
Real-world pipelines
| Pipeline | What gets deployed | Slack channel | Frequency |
|---|---|---|---|
| Sales dashboard | HTML with revenue charts | #sales | Daily |
| Incident postmortem | Timeline + root cause analysis | #engineering | Per incident |
| Sprint summary | Velocity, burndown, shipped features | #product | Bi-weekly |
| SEO report | Rankings, traffic, keyword performance | #marketing | Weekly |
| Build artifacts | Test results, coverage report | #ci-cd | Per merge |
| Client deliverable | PDF report or data export | #client-projects | On demand |
Multiple channels
Route different reports to different channels:
async function deployAndNotify(opts: {
project: string;
html: string;
ttl: string;
slackWebhook: string;
title: string;
}) {
const { url } = await deplo.deploy({
project: opts.project,
files: [{ path: 'index.html', content: opts.html, encoding: 'utf8' }],
ttl: opts.ttl,
});
await fetch(opts.slackWebhook, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
text: `📊 *${opts.title}*: <${url}|View>`,
}),
});
}
// Sales → #sales
await deployAndNotify({
project: 'sales-daily',
html: salesReport,
ttl: '7d',
slackWebhook: SALES_WEBHOOK,
title: 'Daily Sales Report',
});
// Engineering → #engineering
await deployAndNotify({
project: 'build-report',
html: buildReport,
ttl: '3d',
slackWebhook: ENG_WEBHOOK,
title: 'Build Report',
});What's next?
- AI-generated reports — let AI build the reports for you
- Generate and deploy PDFs — share documents via URL
- TypeScript SDK — full SDK reference
- CLI Reference — scripting and automation