Deployment
Deploy feature pipelines in GitHub Actions
Chalk provides official support for GitHub Actions. You can install the Chalk CLI and create deployments (preview and production) from pre-built GitHub Actions.
You will need to create a Chalk token from the settings page of your dashboard and store the resulting client ID and secret as GitHub Secrets.
This step supports the following inputs:
client-id: The Chalk Client ID from the tokens page in your settings.client-secret: The Chalk Client Secret from the tokens page in your settings.version (optional): The version of chalk to install, defaulting to latest.api-host (optional): If you’re using a self-hosted deployment, the API host where Chalk is hosted.environment (optional): The Chalk environment to use. Your token is typically scoped to a single environment, and you won’t need to use this parameter.- uses: chalk-ai/cli-action@v2
with:
client-id: ${{secrets.CHALK_CLIENT_ID}}
client-secret: ${{secrets.CHALK_CLIENT_SECRET}}
# Optional: Version of the Chalk CLI to install. Defaults to `latest`
version: latest
# Optional: Environment to use. Optional for environment-scoped tokens.
environment: <environment id>
# Optional: Used for Hybrid Cloud deployments
api-host: https://custom.deployment.com/
For more information, see the chalk-ai/cli-action on the GitHub Marketplace, or see a complete example at chalk-ai/examples.
You can deploy to Chalk by first installing the CLI, as in the section above. Or, you can use the chalk-ai/deploy-action step. This step supports the following inputs:
client-id: The Chalk Client ID from the tokens page in your settings.client-secret: The Chalk Client Secret from the tokens page in your settings.branch (optional): By default, Chalk will deploy to your production environment. With branch, your pipelines will deploy to a Chalk branch.await (optional): Should this step block until it completes? Defaults to true.version (optional): The version of chalk to install, defaulting to latest.api-host (optional): If you’re using a self-hosted deployment, the API host where Chalk is hosted.environment (optional): The Chalk environment to use. Your token is typically scoped to a single environment, and you won’t need to use this parameter.A production deploy checks your features and resolvers before deploying, and the check runs your
project’s Python code. The job needs Python and your project’s dependencies, including chalkpy,
installed before chalk apply runs. Use the Python version that matches the runtime in your
project’s chalk.yaml. Add these steps before the deploy step.
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# Your project's dependencies, including chalkpy
- run: pip install -r requirements.txt
- uses: chalk-ai/deploy-action@v2
with:
client-id: ${{secrets.CHALK_CLIENT_ID}}
client-secret: ${{secrets.CHALK_CLIENT_SECRET}}
# Optional: Version of the Chalk CLI to install. Defaults to `latest`
version: latest
# Optional: Environment to use. Optional for environment-scoped tokens.
environment: <environment id>
# Optional: Used for Hybrid Cloud deployments
api-host: https://custom.deployment.com/