From 8ef8d7cde74643d75ca705a1f511a12ab31022dd Mon Sep 17 00:00:00 2001 From: Enrico Campidoglio Date: Fri, 25 Oct 2019 00:46:51 +0200 Subject: [PATCH] Documents the Cake action in the README file --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 126d0a85..6f047e76 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,52 @@ -# Cake GitHub Action +# Cake for GitHub Actions -This action allows you to run a Cake script from your GitHub Actions workflow without having to rely on a bootstrapper. +| Build Status | Coverage | +| :----------: | :------: | +| [![GitHub Actions](https://github.com/ecampidoglio/cake-action/workflows/Build/badge.svg)](https://github.com/ecampidoglio/cake-action/actions?workflow=Build) | [![Coveralls](https://coveralls.io/repos/github/ecampidoglio/cake-action/badge.svg)](https://coveralls.io/github/ecampidoglio/cake-action) | + +This action allows you to run a Cake script from your GitHub Actions workflow without having to use a [bootstrapper](https://github.com/cake-build/resources). + +## Usage + +Using the Cake action from a GitHub Actions workflow is as simple as referencing [this repository](https://github.com/ecampidoglio/cake-action) from a [build step](https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps): + +```yml +steps: + - name: Run the Cake script + uses: ecampidoglio/cake-action@master +``` + +The Cake action will look for a script named `build.cake` in your repository's root directory and run it for you using the [Cake Tool](https://www.nuget.org/packages/Cake.Tool/). All output from the Cake script will be automatically redirected to the build log for inspection. + +## Inputs + +### `script-path` + +If your script is in another location, you can specify the path with the `script-path` [input parameter](https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswith): + +```yml +steps: + - name: Run the Cake script + uses: ecampidoglio/cake-action@master + with: + script-path: path/to/script.cake +``` + +### `target` + +You'll likely want to specify which task to run out of the ones defined in the Cake script. For that, you can use the `target` parameter: + +```yml +steps: + - name: Run the Cake script + uses: ecampidoglio/cake-action@master + with: + script-path: path/to/script.cake + target: Task-To-Run +``` + +And that's it. The rest of this document describes the other options that the Cake action supports. + +## Cross-platform + +Since the [Cake Tool](https://www.nuget.org/packages/Cake.Tool/) is built on .NET Core, this action will run on any of the [virtual environments](https://help.github.com/en/github/automating-your-workflow-with-github-actions/software-in-virtual-environments-for-github-actions) supported by GitHub Actions, namely Linux, Windows and macOS.