Deploy from GitHub Actions in one step
pbc ci init writes the GitHub Actions workflow that deploys the current
directory, wired to a new official action:
$ pbc ci init
Wrote .github/workflows/deploy.yml — deploys this frontend on every push to main.
Two things left, both one-time:
1. Copy your token: portal → Account → CLI access token → Copy.
2. Add it as a repository secret named PBC_TOKEN:
Settings → Secrets and variables → Actions → New repository secret.
Then commit both files:
git add .github/workflows/deploy.yml pbc.json
git commit -m "Deploy on push"
The generated file:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: pocketbasecloud/cli/action@v0.5.0
with:
token: ${{ secrets.PBC_TOKEN }}
kind: frontend
pocketbasecloud/cli/action installs pbc, checks the token before touching
anything, and deploys — the same --no-input --json call the CLI has always
supported. What it adds: a PocketBase deploy’s record carries
adminUsername/adminPassword, and GitHub only masks values it has been told
are secret. The action masks both before it reads anything else in the
record, and only ever publishes six fields (url, id, name, status,
kind, environment) as step outputs — the raw JSON never reaches the log.
Existing hand-written workflows keep working unchanged; pbc ci init
generates the same thing you’d otherwise write by hand, including
concurrency and timeout-minutes, which are easy to forget and expensive to
miss. See Deploying from GitHub Actions
and the CI/CD reference.