# Unity Build Automation

> Learn how to integrate the CLI with Unity Build Automation.

In your [Dashboard], navigate to `DevOps` > `Build Automation` > `Configurations` and create a new configuration.

In the advanced settings for your new configuration, you can set environment variables.

As an example, try setting the following environment variables:

| Variable                       | Value                   |
| ------------------------------ | ----------------------- |
| UGS\_CLI\_PROJECT\_ID          | your-project-id         |
| UGS\_CLI\_SERVICE\_KEY\_ID     | your-service-key-id     |
| UGS\_CLI\_SERVICE\_SECRET\_KEY | your-service-secret-key |

In the repository you've configured for your services, create a new `.sh` file that will contain your UGS CLI commands. Then, in your new configuration's advanced settings, set a script hook with the name of the `.sh` file. There are two fields `pre-build` which lets you execute your file before building, or `post-build` which executes your file after building.

Example content for the `.sh` file:

```sh
#!/bin/bash
ugs --version
ugs config get environment
ugs status
ugs env list
ugs deploy <directory-with-service-configurations> -j
```

[Dashboard]: https://dashboard.unity3d.com/
