Skip to content

cap-jmk-real/shiphook

Repository files navigation

Shiphook

Ship on hook. One webhook, one command. Receive a POST → git pull → run your deploy script. Configure the deployment via YAML or env vars. No SaaS, no containers. Just Node and your repo.

Built for indie devs, micro-SaaS, and open-source projects that want simple, self-hosted deploys.

CI npm version License: MIT TypeScript Node Docs CodeRabbit Reviews


Install

npm install -g shiphook

Run

cd /path/to/your/repo
shiphook

By default Shiphook listens on port 3141. Send a POST to trigger a deploy:

curl -X POST http://localhost:3141/

It runs git pull in the repo, then your script (default: npm run deploy). Response is JSON with pull and run output.

Why Shiphook?

  • No vendor lock-in — Your server, your script, your Git. No third-party deploy service.
  • YAML or env — Put shiphook.yaml in your repo (or set env vars). Env overrides file. Run and point your Git webhook at it.
  • Fits your stack — Use npm run deploy, pnpm build, ./deploy.sh, or anything else.
  • Secret-based auth — Set SHIPHOOK_SECRET; send it as X-Shiphook-Secret or Authorization: Bearer <secret> so only your Git provider can trigger deploys.

Configuration (YAML or env)

Add a shiphook.yaml in your repo (see shiphook.example.yaml) or set env vars. Env overrides the file.

Option Default Description
port / SHIPHOOK_PORT 3141 Server port.
repoPath / SHIPHOOK_REPO_PATH current dir Repo path for git pull and script.
runScript / SHIPHOOK_RUN_SCRIPT npm run deploy Command run after pull.
secret / SHIPHOOK_SECRET If set, request must send this (header or Bearer).
path / SHIPHOOK_PATH / Webhook path (e.g. /deploy).

GitHub webhook

  1. Repo → SettingsWebhooksAdd webhook.
  2. Payload URL: https://your-server:3141/ (or your path).
  3. Secret: (optional) Same as SHIPHOOK_SECRET.
  4. Events: Push events.
  5. Save. Every push triggers a deploy.

Docs

Full docs (install, config, webhooks, programmatic API): Documentation

Programmatic use

import { createShiphookServer, loadConfig } from "shiphook";

const config = loadConfig();
const server = createShiphookServer(config);
await server.start();

License

MIT.

About

Ship on hook. Webhook → git pull → run your deploy script. Configure via shiphook.yaml or env. Self-hosted ideal for indie devs and micro-SaaS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors