Patchbay
Sign inStart free trial

Publish from CI

The CLI needs Node 20+, your project's dependencies and two values. Any CI that can run npx works.

GitHub Actions

Add PATCHBAY_TOKEN as a repository secret (Settings → Secrets and variables → Actions), then:

# .github/workflows/ota.yml
name: Publish update
on:
  push:
    branches: [main]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 22, cache: npm }
      - run: npm ci
      - run: sudo apt-get install -y bsdiff   # optional: smaller patch downloads
      - run: npx patchbay-cli publish --channel production --message "$COMMIT_MESSAGE"
        env:
          PATCHBAY_TOKEN: ${{ secrets.PATCHBAY_TOKEN }}
          PATCHBAY_APP: app_k3m9x2p7qa
          # Passed as an env var, never pasted into the script, so a commit message can't run commands.
          COMMIT_MESSAGE: ${{ github.event.head_commit.message }}

Good habits