A composite GitHub Action that installs the smbCloud CLI
(smb) and deploys your app non-interactively from CI.
It wraps the CLI's --ci (non-interactive) deploy flow: provision a token,
optionally install an SSH key, then run smb --ci deploy. Your .smb/config.toml
picks the deploy strategy (nextjs-ssr, vite-spa, rails, rust, swift, or
generic rsync/git), so the same step works for any stack.
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: smbcloudXYZ/smbcloud-deploy-action@v1
with:
token: ${{ secrets.SMB_TOKEN }}That installs the latest CLI, writes the token, and runs smb --ci deploy
against the project pinned in your .smb/config.toml.
For a monorepo config with several [[projects]] entries, name the target.
Non-interactive mode won't prompt you to choose:
- uses: smbcloudXYZ/smbcloud-deploy-action@v1
with:
token: ${{ secrets.SMB_TOKEN }}
project: my-web-appDeploy paths that upload over rsync need the account-scoped SSH key. smbCloud
expects it at ~/.ssh/id_<user-id>@smbcloud:
- uses: smbcloudXYZ/smbcloud-deploy-action@v1
with:
token: ${{ secrets.SMB_TOKEN }}
ssh-private-key: ${{ secrets.SMB_SSH_KEY }}
ssh-key-name: id_<user-id>@smbcloud
ssh-known-hosts: ${{ secrets.SMB_KNOWN_HOSTS }}Pin ssh-known-hosts instead of disabling host-key checking.
| Input | Required | Default | Description |
|---|---|---|---|
token |
yes | (required) | smbCloud auth token contents (from a CI secret). Written to the CLI state dir to authenticate smb. |
environment |
no | production |
production or dev. Selects API host and state dir (.smb vs .smb-dev). |
project |
no | "" |
Monorepo sub-project name (the name in a [[projects]] entry). |
working-directory |
no | . |
Directory containing .smb/config.toml. |
version |
no | latest |
CLI version to install (e.g. 0.5.0, v0.5.0, or latest). |
ssh-private-key |
no | "" |
SSH private key contents for rsync/SSH deploys. |
ssh-key-name |
no | "" |
Filename under ~/.ssh for the key. Required when ssh-private-key is set. |
ssh-known-hosts |
no | "" |
Entries appended to ~/.ssh/known_hosts. |
args |
no | "" |
Extra arguments appended to smb deploy. |
cli-repository |
no | smbcloudXYZ/smbcloud-cli |
Repository to download the CLI binary from. |
| Output | Description |
|---|---|
smb-path |
Absolute path to the installed smb binary. |
version |
Resolved CLI version that was installed. |
After this step runs, smb is on PATH and authenticated, so later steps can
call it directly (e.g. smb me, smb migrate).
- Install. Downloads the prebuilt
smb-<os>-<arch>release binary for the runner, makes it executable, and adds it toPATH. Works on Linux, macOS, and Windows runners (amd64/arm64). - Configure. Writes the token to
~/.smb/token(production) or~/.smb-dev/token(dev) with600perms, then installs the SSH key andknown_hostsif you passed them. - Deploy. Runs
smb --ci --environment <env> deploy [--project <name>]inworking-directory. The exit code propagates, so a failed deploy fails the job.
Logging in is interactive and cannot run under --ci, so provision the token
ahead of time and store its contents in a CI secret. See
docs/ci.md
in the CLI repo for token setup and the full non-interactive behavior reference.