Skip to content

Deploy your project

Run these commands from your organisation directory. If you followed Creating your first process, you already installed the CLI in your project; bun run pfcli runs that local copy. Otherwise, install @processfocus/cli at the same version as your processfocus package. Keep the lockfile and leave platformRef unset to deploy the public release you tested locally.

Sign in to the Console that hosts your project. If you use a different Console, replace the URL in the login command. Later commands use the Console you logged in to.

Terminal window
bun run pfcli auth login --base-url https://console.processfocus.com
bun run pfcli projects

If you need a new project, run bun run pfcli project create --name my-org --region <region-id> with a region ID from your Console. Use the project number from the creation receipt or the project list. For a new project, create a stage for configuration and an environment to deploy into:

Terminal window
PROJECT=your-project-number
bun run pfcli stage add --project "$PROJECT" dev
bun run pfcli env add --project "$PROJECT" --stage dev dev

For an existing environment, skip creation and use its stage and environment names below. If your organisation uses Google sign-in, export its GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in your shell, then copy them to the stage. Passing just the key reads its value from the environment.

Terminal window
bun run pfcli config set --project "$PROJECT" --stage dev GOOGLE_CLIENT_ID
bun run pfcli config set --project "$PROJECT" --stage dev GOOGLE_CLIENT_SECRET --secret
bun run pfcli deploy . --project "$PROJECT" --env dev

The CLI builds and uploads the organisation, waits for the deployment, and prints the frontend URL. If it reports InsufficientProjectCredit, ask an operator to run Add Project Credit for your project number, then retry. If your terminal disconnects, check whether the deployment is still running before starting another:

Terminal window
bun run pfcli deploy status --project "$PROJECT" --env dev

Open /login on the printed frontend URL. For Google sign-in, register that origin followed by /oauth/google/callback as an authorised redirect URI on the Google OAuth client. Sign in with an invited email address if your organisation is invite-only. Redeploy after changing stage configuration.

For an invite-only organisation using passkeys, skip the Google configuration and callback. After deployment, generate a registration link for the invited email on the hosted environment:

Terminal window
bun run pfcli invitation registration-link --project "$PROJECT" --env dev --email admin@example.com

Replace the sample email with the address in your invitation. Deliver the link privately to that person; anyone holding it can use it to register the passkey.

Your own GitHub repository can deploy to Process Focus Cloud using OpenID Connect (OIDC) federation. GitHub supplies a signed assertion for the running job, which pfcli exchanges for short-lived Process Focus credentials. You do not need to store a Process Focus password, client secret, or personal login token in GitHub.

You need:

  • A Process Focus Cloud project that you own, with an existing deployment environment.
  • Your organisation source in a GitHub repository.

For a published SDK installed from the npm registry with a Bun, npm, pnpm, or Yarn lockfile, leave platformRef unset. Yarn must install into node_modules. The Backend verifies the exact installed processfocus release and builds from its attested public commit.

For workspace builds or unpublished packages, set platformRef on your Organisation to a branch or full commit SHA in the platform repository. Set platformSource: "public" to select the public mirror.

In the Console, select your project and deployment environment, then open the Info tab. Use the value under Environment for --env and the project number in the sentence below the site URL for --project.

Console Info tab with the environment name and project number circled

Add the CLI to your project’s development dependencies. For example, with Bun:

Terminal window
bun add --dev --exact @processfocus/cli@next

The workflow below uses Bun and assumes a committed Bun lockfile. Adapt the install and run commands if your project uses another package manager. It also assumes the organisation is at the repository root; if it is in a subdirectory, replace . in the deploy command with that path.

In the Console, select your project and open OIDC federation. Under Register a GitHub Actions identity, enter these values, replacing the repository with your own:

Field Example
Name GitHub production deploy
Repository your-account/your-repository
Branch main
Workflow path .github/workflows/deploy.yml
GitHub Environment (optional) Leave blank for this example. If the job sets environment:, enter that GitHub Environment name.
Events workflow_dispatch,push
Project permissions deploy

Leave Enabled selected. Project permissions control which OAuth scopes Process Focus Cloud will issue to this workflow for the selected project. They are separate from GitHub Actions permissions such as id-token: write. Grant only deploy for this example: create-environment and destroy-environment let a workflow add or remove environments, which this workflow doesn’t do. You can grant only project permissions you already have.

The registration starts as pending and cannot deploy until it has enrolled. Expand Workflow configuration to find its generated example. Use the values from that example, not values copied from another project.

Under your GitHub repository’s Settings → Secrets and variables → Actions → Variables, create these repository variables:

Variable Value from the generated example
PFCLI_BASE_URL The PFCLI_BASE_URL endpoint
PFCLI_WORKLOAD_CLIENT_ID The federated identity’s client ID
PFCLI_GITHUB_AUDIENCE The audience in the Deploy step
PFCLI_ENROLLMENT_AUDIENCE The audience in the one-time Enroll federated identity step

The client ID and audiences are configuration values, not client secrets. The enrollment audience and permanent deployment audience are different: use each only for its corresponding step. Copy the generated endpoint exactly; do not substitute the URL of your deployed organisation.

Save this as .github/workflows/deploy.yml on the registered main branch. Replace 0000-0000-0002 and prod with your project number and existing Process Focus environment name:

name: Deploy to Process Focus
on:
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: process-focus-production
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
env:
PFCLI_AUTH_MODE: github-workload
PFCLI_BASE_URL: ${{ vars.PFCLI_BASE_URL }}
PFCLI_WORKLOAD_CLIENT_ID: ${{ vars.PFCLI_WORKLOAD_CLIENT_ID }}
PFCLI_GITHUB_AUDIENCE: ${{ vars.PFCLI_GITHUB_AUDIENCE }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.5"
- name: Install dependencies
run: bun install --frozen-lockfile
# Run once, then remove this step before the next run.
- name: Enroll federated identity
run: bun run pfcli workload enroll
env:
PFCLI_GITHUB_AUDIENCE: ${{ vars.PFCLI_ENROLLMENT_AUDIENCE }}
- name: Deploy
run: bun run pfcli deploy . --project 0000-0000-0002 --env prod

The deploy command’s --env prod selects the Process Focus environment. This example does not use a GitHub Environment.

Run the workflow from GitHub’s Actions tab, selecting the registered branch. The one-time enrollment binds the registration to GitHub’s signed repository and owner IDs. The following deploy step uses the permanent audience to build and upload the organisation, then waits for deployment to finish. No pfcli auth login step is needed.

After successful enrollment, reload OIDC federation in the Console and check that the status is enrolled. Remove the Enroll federated identity step from the workflow and delete the PFCLI_ENROLLMENT_AUDIENCE GitHub variable before running it again. Keep the permanent audience for subsequent deployments.

To deploy automatically on pushes after enrollment, add a push trigger restricted to the registered branch, alongside workflow_dispatch:

on:
workflow_dispatch:
push:
branches: [main]

To require approvals or restrict deployment branches in GitHub, create a GitHub Environment such as production under your repository’s Settings → Environments and configure its protection rules. Enter the same name in the registration’s GitHub Environment field and add environment: production to the deploy job alongside runs-on. Keep --env set to your target Process Focus environment; the names do not have to match.

Adding, changing, or removing a GitHub Environment requires enrolling again. Use the new enrollment audience from Workflow configuration.

Authentication failures and access changes

Section titled “Authentication failures and access changes”

If authentication fails, check that id-token: write is present and that the repository, branch, workflow path, GitHub Environment, and event match the registration. If the registration has no GitHub Environment, omit environment: from the job. Customer OIDC federation registrations support push, workflow_dispatch, and schedule, not pull-request events.

Changing those trust settings requires enrollment again. Disabling or removing the registration blocks new access and its existing tokens’ project access; it does not cancel work that has already started.

Project federated identity tokens last at most 15 minutes and have no refresh token. Long-running CLI commands obtain fresh GitHub assertions when needed. Keep assertions and access tokens out of logs even though they are short-lived. If a deployment loses its connection, inspect its execution in the Console before retrying: it may still be running.