Git-driven CI/CD.
git push relais-production main
Download the latest binary from Releases and put it on your PATH:
# Linux (x86_64)
curl -fsSL https://github.com/poyea/relais/releases/latest/download/relais-linux-x86_64 \
-o ~/.local/bin/relais && chmod +x ~/.local/bin/relais
# Linux (ARM64)
curl -fsSL https://github.com/poyea/relais/releases/latest/download/relais-linux-aarch64 \
-o ~/.local/bin/relais && chmod +x ~/.local/bin/relais
# Windows x86_64 (PowerShell)
irm https://github.com/poyea/relais/releases/latest/download/relais-windows-x86_64.exe `
-OutFile "$env:LOCALAPPDATA\Microsoft\WindowsApps\relais.exe"
# Windows ARM64 (PowerShell)
irm https://github.com/poyea/relais/releases/latest/download/relais-windows-aarch64.exe `
-OutFile "$env:LOCALAPPDATA\Microsoft\WindowsApps\relais.exe"- You need a
.relais.json. - Run
relais initfor bootstrapping. - Deploy by pushing to that remote. The hook runs on the server: checks out the branch, then runs your script.
- Local: Zig 0.14.0 (to build), an SSH key, Git
- Server: Linux, Git, Bash,
base64(standard on all distros)
Commit this to your repo root.
{
"targets": {
"production": {
"host": "prod.example-service.com",
"user": "deploy",
"ssh_key": "~/.ssh/id_relais",
"port": 22,
"remote_dir": "/srv/myapp",
"script": "./scripts/deploy.sh",
"branches": ["main"]
},
"staging": {
"host": "staging.example-service.com",
"user": "deploy",
"ssh_key": "~/.ssh/id_relais",
"remote_dir": "/srv/myapp-staging",
"script": "./scripts/deploy.sh",
"branches": ["develop"]
}
}
}| Field | Required | Default | Description |
|---|---|---|---|
host |
β | SSH hostname or IP | |
user |
β | SSH user on the server | |
ssh_key |
β | Path to private key (~ is expanded) |
|
port |
22 |
SSH port | |
remote_dir |
β | Directory on the server to check out into | |
script |
β | Path to deploy script, relative to remote_dir |
|
branches |
β | Only pushes to these branches trigger the script |
relais init # bootstrap all targets in .relais.json
relais init production # bootstrap one target
git push relais-production main # deploy
git push relais-staging develop
relais versionrelais doesn't care what your script does. A minimal example:
#!/usr/bin/env bash
# scripts/deploy.sh that runs inside remote_dir on the server
set -euo pipefail
docker compose pull
docker compose up -d --remove-orphans# Install Zig 0.14.0: https://ziglang.org/download/
git clone https://github.com/poyea/relais
cd relais
zig build # native debug binary β zig-out/bin/relais
zig build -Doptimize=ReleaseSafe # native optimised
zig build linux -Doptimize=ReleaseSafe # static x86_64-linux-musl
zig build windows -Doptimize=ReleaseSafe # x86_64-windows
zig build all -Doptimize=ReleaseSafe # both release targets
zig build test # run unit testsBinaries land in zig-out/bin/.
MIT
