Skip to content

Deploy from the command line

Deploy, follow logs and roll back from your terminal or CI with the BuildPusher CLI.

1Install it

Run curl -fsSL https://buildpusher.com/cli/install.sh | sh. It’s one PHP file, so it needs PHP 8.1 or later.

2Log in

Create an API token with the Deploy scopes under Account → API tokens, then run buildpusher login and paste it. In CI, set BUILDPUSHER_TOKEN instead.

3Deploy

Run buildpusher deploy <project> [environment] --wait to deploy and follow the log; add --ref=v1.4.0 to deploy a tag, branch or commit. It exits non-zero if the deploy fails, so CI jobs fail with it.

4Follow and undo

buildpusher status lists recent deploys, buildpusher logs <id> --follow streams one, and buildpusher rollback <id> goes back to the release a deploy shipped.

5Set defaults

Put {"project": "shop", "environment": "staging"} in .buildpusher.json at the root of your repository to leave them off each command.

6In GitHub Actions or code

Deploy from a workflow with the BuildPusher GitHub Action (buildpusher/deploy-action), which waits for the result, fails the job if the deploy fails, and comments the result on the pull request; or from your own code with the PHP (buildpusher/sdk) and JavaScript (@buildpusher/sdk) SDKs.

Still stuck?Email us, or send feedback from inside the app.