Deplo
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 Slack

TypeScript 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.sh

With 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

PipelineWhat gets deployedSlack channelFrequency
Sales dashboardHTML with revenue charts#salesDaily
Incident postmortemTimeline + root cause analysis#engineeringPer incident
Sprint summaryVelocity, burndown, shipped features#productBi-weekly
SEO reportRankings, traffic, keyword performance#marketingWeekly
Build artifactsTest results, coverage report#ci-cdPer merge
Client deliverablePDF report or data export#client-projectsOn 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?

On this page