@discoverworthy/deploy

Deploy static sites to DiscoverWorthy hosting
3,281
Install
npm install @discoverworthy/deploy
Latest Version:1.9.1
License:MIT
Last Updated:Sep 28, 2026
Links: npm
Maintainer: discoverworthy

@discoverworthy/deploy

Deploy static sites to DiscoverWorthy hosting and pull blog content managed by your clients.

Works with any framework that outputs static files — React, Next.js, Vue, Angular, Blazor WASM, Hugo, Jekyll, Astro, plain HTML, and more.

Quick Start

# Put your token in .env (gitignored) — dw-deploy loads it automatically:
#   DISCOVERWORTHY_DEPLOY_TOKEN=your-token
# ...or export it for one-off runs:
export DISCOVERWORTHY_DEPLOY_TOKEN=your-token

# Pull blog posts written by your client, build, and deploy
npx @discoverworthy/deploy pull
npm run build
npx @discoverworthy/deploy --dir=out

Commands

deploy (default)

Upload your built site to DiscoverWorthy hosting.

npx @discoverworthy/deploy --dir=out

pull

Download published blog posts as MDX files into your content directory. Your client writes posts in the DiscoverWorthy dashboard — this command pulls them into your project so your build can pick them up.

# Pull posts into the default content path (configured in DiscoverWorthy)
npx @discoverworthy/deploy pull

# Pull into a specific directory
npx @discoverworthy/deploy pull --dir=src/content/blog

# Clean existing MDX files before pulling (full sync)
npx @discoverworthy/deploy pull --clean

The pull command:

  • Downloads all published blog posts for your site as .mdx files
  • Each file includes frontmatter (title, slug, date, topic, excerpt, keywords, cover image)
  • Files are named by slug: my-blog-post.mdx
  • Defaults to the content path configured in your DiscoverWorthy hosting settings (typically content/blog)

Typical Workflow

Your client writes blog posts in DiscoverWorthy. You pull them into your project, build, and deploy:

npx @discoverworthy/deploy pull        # grab latest posts
npm run build                           # your framework builds with new posts
npx @discoverworthy/deploy --dir=out   # push to hosting

Automate with a prebuild script

Add pull to your package.json so every build includes the latest posts:

{
  "scripts": {
    "prebuild": "npx @discoverworthy/deploy pull",
    "build": "astro build",
    "deploy": "npx @discoverworthy/deploy --dir=dist"
  }
}

CI/CD

GitHub Actions

- name: Pull content & Deploy
  env:
    DISCOVERWORTHY_DEPLOY_TOKEN: ${{ secrets.DISCOVERWORTHY_DEPLOY_TOKEN }}
  run: |
    npx @discoverworthy/deploy pull
    npm run build
    npx @discoverworthy/deploy --dir=out

Azure DevOps Pipelines

- script: |
    npx @discoverworthy/deploy pull
    npm run build
    npx @discoverworthy/deploy --dir=out
  displayName: 'Pull content, build & deploy'
  env:
    DISCOVERWORTHY_DEPLOY_TOKEN: $(DISCOVERWORTHY_DEPLOY_TOKEN)

Options

Flag Default Description
--dir out (deploy) / auto (pull) Directory for built site output or content pull destination
--token — Deploy token (or set DISCOVERWORTHY_DEPLOY_TOKEN)
--exclude — Glob pattern to exclude (deploy only, repeatable)
--include-all — Disable auto-exclusions and upload everything (deploy only)
--clean — Remove existing .mdx files before pulling (pull only)

Smart Defaults

The deploy tool automatically excludes files that aren't needed for hosting:

  • Next.js RSC data (__next.* directories) — prefetch optimization files
  • Source maps (*.map)
  • OS metadata (.DS_Store, Thumbs.db)

Use --include-all to disable this and upload everything.

Framework Output Directories

Framework Build Command Output Dir
Next.js (static) next build out
Vite / Vue / Svelte npm run build dist
React (CRA) npm run build build
Angular ng build dist/<project>
Blazor WASM dotnet publish release/wwwroot
Hugo hugo public
Astro astro build dist

MDX Frontmatter Format

Pulled blog posts use this frontmatter structure, compatible with most static site frameworks:

---
title: "How to Improve Your SEO Rankings"
slug: "improve-seo-rankings"
date: "2026-03-22"
topic: "SEO"
excerpt: "A practical guide to improving your search rankings."
coverImage: "https://storage.discoverworthy.com/images/cover.webp"
keywords:
  - "seo tips"
  - "search rankings"
  - "organic traffic"
---

Your blog post content in markdown...

LLM Prompts for Integration

Use these prompts with your AI coding assistant to wire up blog content quickly:

Astro

Add a content collection for blog posts in content/blog/. Each post is an MDX file with frontmatter: title (string), slug (string), date (string), topic (string, optional), excerpt (string, optional), coverImage (string URL, optional), keywords (string array, optional). Create a dynamic route at /blog/[slug] that renders the MDX content with a layout showing the title, date, topic, and cover image. Add a /blog listing page sorted by date descending.

Next.js (App Router)

Create a blog section using MDX files from content/blog/. Each MDX file has frontmatter: title, slug, date, topic, excerpt, coverImage, keywords. Use gray-matter to parse frontmatter and next-mdx-remote to render content. Create a dynamic route at app/blog/[slug]/page.tsx and a listing page at app/blog/page.tsx. Include Open Graph metadata from the frontmatter.

Hugo

Set up a blog section that reads markdown from content/blog/. Posts have frontmatter: title, slug, date, topic (mapped to a taxonomy), excerpt (used as description), coverImage (used as featured image), keywords. Create a list template at layouts/blog/list.html and a single template at layouts/blog/single.html. Add the blog to the site navigation.

Gatsby

Add a blog using MDX files from content/blog/. Frontmatter fields: title, slug, date, topic, excerpt, coverImage, keywords. Use gatsby-plugin-mdx and gatsby-source-filesystem. Create pages programmatically in gatsby-node.js using the slug field. Build a blog index page at /blog with cards showing title, date, excerpt, and cover image.

Get Your Deploy Token

Your deploy token is available in the DiscoverWorthy dashboard under Website Hosting → Connection Details, or ask your client to send you the setup link. If you use Rigg, dw_publish hands you the value to set.

The deploy token is your workspace token — the same bearer value the Rigg MCP uses. There is no separate sk_… deploy secret; "deploy token" and "workspace token" are the same thing. Treat it as a secret and keep it out of version control — put it in .env (gitignored) or a CI secret, never commit it.

.env is loaded automatically

dw-deploy reads a .env file from the current working directory on startup, so this is all you need:

# .env  (add .env to .gitignore)
DISCOVERWORTHY_DEPLOY_TOKEN=your-token
{
  "scripts": {
    "deploy": "next build && dw-deploy --dir=out"
  }
}

dw-deploy runs as its own process — it does not inherit the dotenv your framework's build step loads for itself, which is why it loads .env directly. Real environment variables (CI secrets, export …) always take precedence over .env.

API Host

By default the CLI talks to https://app.discoverworthy.com (where the hosting API lives). Override with DISCOVERWORTHY_API_URL only if you've been told to point at a different environment — note that the bare apex discoverworthy.com is the marketing site and will fail auth, because its cross-origin redirect to the app strips the Authorization header.

Upgrade if you're on a version before 1.5.0. Those versions targeted the apex by default, so every deploy failed with fetch failed or Missing deploy token — errors that look like an auth problem but are really a host problem. If you see either message, check your installed version first (npx @discoverworthy/deploy --version) before regenerating tokens:

npm install --save-dev @discoverworthy/deploy@latest

From 1.5.1 the CLI detects an apex DISCOVERWORTHY_API_URL, warns, and corrects it automatically, and auth failures print what to check.

Limits

  • Large static exports are supported — the bundle is compressed and streamed directly to storage, not through a request body. Maximum bundle size: 500 MB.
  • Supports any static files (HTML, CSS, JS, images, WASM, fonts, etc.)
  • Requires Node.js 18+ (uses the built-in fetch and zlib).

Related Packages

@attd/front-deploy

Deploy Frontend static projects to Cloudflare Pages with a single command

1,397
@codeenvision/ui-webcomponents

Cluster Envision reusable Web Components built on top of the CE UI framework.

5,250
@clusterenvision/ui-webcomponents

Cluster Envision reusable Web Components built on top of the CE UI framework.

1,776
astra-blogs-lib

A standalone JavaScript library for fetching and managing blog content from GitH...

2,102
aws-spa

A no-brainer script to deploy a single page app on AWS

8,157 42

Version History

Version Released License
1.9.1 MIT
1.9.0 MIT
1.8.1 MIT
1.8.0 MIT
1.7.1 MIT