Skip to content

Deploy to several servers

statio works per server. Each server runs its own agent, with its own hostname, and CI picks one by setting target.

Run the same two steps you ran on the first:

Terminal window
curl -fsSL https://statio.accentio.dev/install.sh | sudo sh
sudo statio init server
sudo statio app add api

init server prints that agent’s address. It differs from the first one.

2. Give the workflow a target per environment

Section titled “2. Give the workflow a target per environment”
jobs:
staging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: accentiostudios/statio@v1
with:
target: statio-staging.your-tailnet.ts.net
service: api
image: ghcr.io/your-org/api
ts-oauth-client-id: ${{ secrets.STATIO_TS_OAUTH_CLIENT_ID }}
ts-oauth-secret: ${{ secrets.STATIO_TS_OAUTH_SECRET }}

Both jobs use the same CI OAuth client and the same image. Only target changes.

The agent compares target against its own hostname and rejects a payload addressed elsewhere with 403 [audience], so a wrong target fails loudly instead of deploying to the wrong box.

Terminal window
statio logs api --target statio-staging.your-tailnet.ts.net
statio logs api --target statio.your-tailnet.ts.net

Servers keep separate state and never coordinate.