Setup GitHub Actions

A tutorial on how to set up Score with GitHub Actions.

You can use any Score implementation CLI in your GitHub Action workflows, for example, when you make a code change, and you want the Humanitec Platform Orchestrator to deploy your code to a new environment.

The following is a guide to setting up the Score implementation CLI in your GitHub Action workflows.

For the Score GitHub Action, see Setup Score

Usage

To use the Score GitHub Action, add the following step to your workflow:

steps:
  - uses: score-spec/setup-score@v2
    with:
      file: score-compose
      version: '0.6.0'
  - run: score-compose --version

This will download and cache the specified version of the score-compose CLI and add it to PATH.

The action accepts the following inputs:

  • file - The Score CLI tool to install. For example, score-humanitec, score-compose, or score-helm.
  • version - The version of the CLI to install.

Example

Here is a complete example workflow:

name: Score Example

on: push

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: score-spec/setup-score@v2
        with:
          file: score-compose
          version: '0.6.0'
      - run: score-compose --version

This installs version 0.6.0 of score-compose, adds it to $PATH, and runs score-compose --version to verify it is set up correctly.

The action caches the Score binary, so it won’t need to download it each run.