CI/CD
Automate Press.js Cloud deploys in your CI/CD pipeline. The cloud CLI is a single native binary with no runtime dependencies — ideal for CI environments.
Download the binary
Section titled “Download the binary”The cloud CLI is published as a standalone binary for each release. Download the archive for your platform, extract it, and use it directly.
# Linux x86_64curl -OL https://github.com/press-js/press-cloud-cli/releases/latest/download/press-cloud-cli-0.1.0-x86_64-unknown-linux-gnu.tar.gztar -xzf press-cloud-cli-0.1.0-x86_64-unknown-linux-gnu.tar.gz./press-cloud-cli --versionAvailable artifacts
Section titled “Available artifacts”| Platform | Archive |
|---|---|
| Linux x86_64 | press-cloud-cli-{version}-x86_64-unknown-linux-gnu.tar.gz |
| Linux ARM64 | press-cloud-cli-{version}-aarch64-unknown-linux-gnu.tar.gz |
| macOS x86_64 | press-cloud-cli-{version}-x86_64-apple-darwin.tar.gz |
| macOS ARM64 | press-cloud-cli-{version}-aarch64-apple-darwin.tar.gz |
| Windows x86_64 | press-cloud-cli-{version}-x86_64-pc-windows-msvc.zip |
| Windows ARM64 | press-cloud-cli-{version}-aarch64-pc-windows-msvc.zip |
Each release also includes a SHA256SUMS file to verify integrity.
Version pinning
Section titled “Version pinning”Replace latest/download with a specific tag to pin a version:
curl -OL https://github.com/press-js/press-cloud-cli/releases/download/v0.1.0/press-cloud-cli-0.1.0-x86_64-unknown-linux-gnu.tar.gzUsing API keys in CI
Section titled “Using API keys in CI”Create an API key from the Press.js Cloud dashboard, then store it as a secret in your CI platform.
The cloud CLI authenticates via the PRESS_CLOUD_TOKEN environment variable:
export PRESS_CLOUD_TOKEN=pcak_xxxxx./press-cloud-cli deploy --entry my-report --artifact-path ./dist --route / --title "My Report"GitHub Actions
Section titled “GitHub Actions”name: Deploy to Press.js Cloudon: push: branches: [main]
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Download cloud CLI run: | curl -OL https://github.com/press-js/press-cloud-cli/releases/latest/download/press-cloud-cli-0.1.0-x86_64-unknown-linux-gnu.tar.gz tar -xzf press-cloud-cli-0.1.0-x86_64-unknown-linux-gnu.tar.gz
- name: Deploy run: ./press-cloud-cli deploy --entry report --artifact-path ./dist env: PRESS_CLOUD_TOKEN: ${{ secrets.PRESS_CLOUD_TOKEN }}GitLab CI
Section titled “GitLab CI”deploy: image: ubuntu:22.04 before_script: - apt-get update && apt-get install -y curl - curl -OL https://github.com/press-js/press-cloud-cli/releases/latest/download/press-cloud-cli-0.1.0-x86_64-unknown-linux-gnu.tar.gz - tar -xzf press-cloud-cli-0.1.0-x86_64-unknown-linux-gnu.tar.gz script: - ./press-cloud-cli deploy --entry report --artifact-path ./dist variables: PRESS_CLOUD_TOKEN: $PRESS_CLOUD_TOKEN only: - mainBranch-based deploys
Section titled “Branch-based deploys”Use different slugs per branch for preview deployments:
- name: Deploy run: ./press-cloud-cli deploy --entry report --artifact-path ./dist --slug "preview-${GITHUB_HEAD_REF:-main}" env: PRESS_CLOUD_TOKEN: ${{ secrets.PRESS_CLOUD_TOKEN }}This creates separate deploys for each branch — useful for review workflows.
Using the cloud CLI via Press.js CLI
Section titled “Using the cloud CLI via Press.js CLI”If you already use the press CLI and have Node.js in your CI environment, you can install and use the cloud CLI through it:
- uses: actions/setup-node@v4 with: node-version: 22
- run: npm ci
- run: npm install --global @press-js/cli
- name: Install cloud CLI run: press install cloud
- name: Deploy run: press deploy report --slug my-report env: PRESS_CLOUD_TOKEN: ${{ secrets.PRESS_CLOUD_TOKEN }}The press CLI handles the build step and parameter parsing from press.toml automatically.
Best practices
Section titled “Best practices”- Never commit API keys — always use your CI platform’s secret store
- Pin a specific version in production pipelines to prevent unexpected changes from new releases
- Verify checksums using the
SHA256SUMSfile from the release - Install the cloud CLI once per pipeline — the binary is stateless and fully self-contained