Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy Dispatch site

on:
push:
branches: [main]
paths:
- apps/site/**
- package.json
- pnpm-lock.yaml
- .github/workflows/deploy-site.yml

permissions:
contents: read

concurrency:
group: deploy-dispatch-site
cancel-in-progress: true

jobs:
deploy:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9.15.9

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate site
run: pnpm run check:site

- name: Build site
run: pnpm run build:site

- name: Deploy to Cloudflare
run: pnpm --filter @dispatch/site exec wrangler deploy
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Give this prompt to a coding agent to get Dispatch installed as a persistent ser
> 4. Copy `.env.example` to `.env`. The defaults work for local-only use. Set `DISPATCH_HOST=0.0.0.0` only when this machine should accept remote connections. On first visit to the web UI you will be prompted to set a password; sessions are stored as signed HTTP cookies.
> 5. Register as a system service:
> - **macOS**: Run `bin/install-launchd` to create a launchd plist that starts on boot.
> - **Linux**: Create a systemd user service for Xvfb (`~/.config/systemd/user/xvfb.service`) that runs `Xvfb :99 -screen 0 1024x768x24`. Enable with `systemctl --user enable --now xvfb`. Then create the Dispatch service (`~/.config/systemd/user/dispatch.service`) that runs the compiled `dist/bun/dispatch-<version>-bun-linux-x64` or `dist/bun/dispatch-<version>-bun-linux-arm64` binary with `EnvironmentFile=~/.dispatch/server/.env`. Add `DISPATCH_COPY_DISPLAY=:99` to the `.env` file for clipboard image support. Enable with `systemctl --user enable --now dispatch`.
> - **Linux**: Download and extract the latest `dispatch-release.tar.gz` into `~/.dispatch/server`, then create a systemd user service for Xvfb (`~/.config/systemd/user/xvfb.service`) that runs `Xvfb :99 -screen 0 1024x768x24`. Enable with `systemctl --user enable --now xvfb`. Then create the Dispatch service (`~/.config/systemd/user/dispatch.service`) that runs the included `dist/bun/dispatch-<version>-bun-linux-x64` or `dist/bun/dispatch-<version>-bun-linux-arm64` binary with `EnvironmentFile=~/.dispatch/server/.env`. Add `DISPATCH_COPY_DISPLAY=:99` to the `.env` file for clipboard image support. Enable with `systemctl --user enable --now dispatch`.
> 6. Verify: `curl http://127.0.0.1:6767/api/v1/health`
> 7. Check which agent CLIs are installed (`claude --version`, `codex --version`, `agent --version`, `opencode --version`). In the Dispatch UI under Settings, disable any agent types whose CLI is not installed.

Expand Down Expand Up @@ -59,7 +59,7 @@ Give this prompt to a coding agent to get Dispatch installed as a persistent ser
| **tmux** | Agent session management | `brew install tmux` | `apt install tmux` |
| **At least one agent CLI** | The agents Dispatch runs | See below | See below |

Dispatch currently uses an artifact-first deploy path, and production installs run the compiled Bun binary from `dist/bun/`; the host does not need Node just to run Dispatch.
Production installs run the released, compiled Bun binary from `dist/bun/`; the host does not need Node just to run Dispatch.

### Optional

Expand Down
2 changes: 2 additions & 0 deletions apps/site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.astro/
dist/
35 changes: 35 additions & 0 deletions apps/site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Dispatch public site

The public Dispatch website is an Astro static site. It is intentionally separate
from the application bundle: `pnpm run build:bun` only builds the server and web
dashboard needed by the installed product.

## Local development

```bash
pnpm --filter @dispatch/site dev
```

## Validation

```bash
pnpm run check:site
pnpm run build:site
```

## Deployment

The site is a static Cloudflare Worker-assets deployment. Its Wrangler
configuration is the source of truth for the `dispatch.berad.dev` custom
domain; Cloudflare creates the DNS record and certificate on first deployment.

Deploy manually with:

```bash
pnpm --filter @dispatch/site run deploy
```

Pushes to `main` that affect the site run the same deployment through GitHub
Actions. That workflow needs repository secrets named `CLOUDFLARE_API_TOKEN` and
`CLOUDFLARE_ACCOUNT_ID`. The token needs permission to edit Workers and the
`berad.dev` zone.
6 changes: 6 additions & 0 deletions apps/site/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from "astro/config";

export default defineConfig({
site: "https://dispatch.berad.dev",
output: "static",
});
20 changes: 20 additions & 0 deletions apps/site/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@dispatch/site",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"preview:network": "astro preview --host 0.0.0.0",
"check": "astro check",
"deploy": "pnpm run build && wrangler deploy"
},
"devDependencies": {
"@astrojs/check": "^0.9.9",
"astro": "^6.0.0",
"typescript": "^5.9.3",
"wrangler": "^4.0.0"
}
}
Loading
Loading