Documentation

Unity Gaming Services CLI


GitHub Repository

Unity Gaming Services CLI


GitHub Actions

Learn how to integrate the CLI with GitHub Actions.
Read time 1 minuteLast updated a day ago

In your GitHub repository, create a
.yml
file under
.github/workflows
. You can use the following recipe in your
.yml
file as an example. For more information, see the official GitHub Actions Documentation.
Store your project ID and service account credentials as repository secrets named
UGS_CLI_PROJECT_ID
,
UGS_CLI_SERVICE_KEY_ID
and
UGS_CLI_SERVICE_SECRET_KEY
. Never commit credentials to the workflow file.
Sample Recipe:
name: UGS CLI GitHub Actions Demo## Choose what triggers your workflow, here it is triggered for every pushon: push## Setting environment variables from repository secretsenv: UGS_CLI_PROJECT_ID: ${{ secrets.UGS_CLI_PROJECT_ID }} UGS_CLI_SERVICE_KEY_ID: ${{ secrets.UGS_CLI_SERVICE_KEY_ID }} UGS_CLI_SERVICE_SECRET_KEY: ${{ secrets.UGS_CLI_SERVICE_SECRET_KEY }}## Setting the jobsjobs: demo-cli: ## You might want to change the runs-on depending on your needs runs-on: ubuntu-latest steps: - name: Download CLI run: curl -OL https://github.com/Unity-Technologies/unity-gaming-services-cli/releases/latest/download/ugs-linux-x64 - name: Test CLI Commands run: | chmod +x ./ugs-linux-x64 ./ugs-linux-x64 --version ./ugs-linux-x64 config get project-id ./ugs-linux-x64 status ./ugs-linux-x64 env list ./ugs-linux-x64 deploy <directory-with-service-configurations> -j