Skip to content

Commit

Permalink
Adds tutorials to docs (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
rachfop authored Aug 23, 2023
2 parents a99bf19 + 2959247 commit 0d7c0c4
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 10 deletions.
2 changes: 1 addition & 1 deletion content/en/docs/get started/score-humanitec-hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The primary goal of the Score Specification is to quickly and easily describe ho

{{% alert %}}

> If at any point you need help, run `score-humanitec --help` from your terminal.
If at any point you need help, run `score-humanitec --help` from your terminal.

{{% /alert %}}

Expand Down
11 changes: 2 additions & 9 deletions content/en/docs/tutorials/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
title: "Tutorials"
linkTitle: "Tutorials"
weight: 8
date: 2017-01-04
draft: true
draft: false
description: >
Show your user how to work through some end to end examples.
Learn how to use Score with these tutorials.
---

{{% pageinfo %}}
This is a placeholder page that shows you how to use this template site.
{{% /pageinfo %}}

Tutorials are **complete worked examples** made up of **multiple tasks** that guide the user through a relatively simple but realistic scenario: building an application that uses some of your project’s features, for example. If you have already created some Examples for your project you can base Tutorials on them. This section is **optional**. However, remember that although you may not need this section at first, having tutorials can be useful to help your users engage with your example code, especially if there are aspects that need more explanation than you can easily provide in code comments.
59 changes: 59 additions & 0 deletions content/en/docs/tutorials/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "Setup GitHub Actions"
subtitle: "Setup GitHub Actions for Continuous Integration"
weight: 5
draft: false
description: >
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](https://github.com/score-spec/setup-score)

## Usage

To use the Score GitHub Action, add the following step to your [workflow](https://docs.github.com/en/actions/using-workflows/about-workflows):

```yaml
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:

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

0 comments on commit 0d7c0c4

Please sign in to comment.