# GitHub Actions
source: https://docs.chalk.ai/docs/github-actions

## 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.

### Installing the Chalk CLI

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.

### Example

```
- 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.

### Deploying to Chalk

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.

### Example

```
- 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/
```





