The Stably CLI can run in any CI/CD environment, not just GitHub Actions. This guide covers how to authenticate and run tests using environment variables, making it easy to integrate with GitHub Actions, GitLab CI, CircleCI, Jenkins, Bitbucket Pipelines, and other CI systems.Documentation Index
Fetch the complete documentation index at: https://docs.stably.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authentication for CI
In CI environments, authentication is handled through environment variables instead of interactive browser login. You must set two environment variables:Your Stably API key. Get it from the API Keys settings page.
Your Stably project ID. Find it in your Stably dashboard project settings or URL.
Setup Instructions
Get Your API Key
Go to the API Keys settings page and create or copy your API key.
Find Your Project ID
Navigate to your project in the Stably dashboard. The project ID is visible in the project settings or in the URL.
Configure CI Secrets
Add
STABLY_API_KEY and STABLY_PROJECT_ID as secrets in your CI provider’s settings.Basic Usage
Once the environment variables are set, you can run any Stably CLI command without interactive authentication. Stably is fully Playwright compatible — all Playwright CLI options are supported:Loading Test Variables in CI
Use the--env flag to load variables from a named Environment stored in Stably. This avoids managing .env files or duplicating secrets across CI providers.
You can also load from a local .env file committed to your repo (for non-sensitive values):
CI Platform Examples
GitHub Actions
.github/workflows/stably.yml
If you’re using GitHub Actions and want a simpler setup with cloud execution, consider using the Stably GitHub Action instead.
GitLab CI
.gitlab-ci.yml
STABLY_API_KEY and STABLY_PROJECT_ID as CI/CD variables in Settings > CI/CD > Variables. Mark them as Protected and Masked for security.
CircleCI
.circleci/config.yml
STABLY_API_KEY and STABLY_PROJECT_ID in CircleCI under Project Settings > Environment Variables. Project-level environment variables are automatically available to all jobs — no need to redeclare them in the config file.
Jenkins
Jenkinsfile
Bitbucket Pipelines
bitbucket-pipelines.yml
STABLY_API_KEY and STABLY_PROJECT_ID as Repository variables in Repository settings > Pipelines > Repository variables.
Azure DevOps
azure-pipelines.yml
Troubleshooting
Authentication Failed
Authentication Failed
Verify that both Ensure the API key is valid and hasn’t expired.
STABLY_API_KEY and STABLY_PROJECT_ID are correctly set:Browser Not Found
Browser Not Found
Make sure browsers are installed in your CI environment:
Tests Timeout in CI
Tests Timeout in CI
CI environments may be slower than local machines. Increase timeouts:Or configure timeouts in
playwright.config.ts.