From b1a28cb7c0703b51b1568f23b9fcb6d10f027403 Mon Sep 17 00:00:00 2001 From: Ed Fricker Date: Fri, 17 Mar 2023 14:31:31 +0000 Subject: [PATCH] Allow for running with --no-cache flag --- README.md | 3 +++ action.yml | 4 ++++ entrypoint.sh | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 974fa49..ad86a01 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ This Action [builds](https://docs.convox.com/deployment/builds) an app based on **Required** The name of the [Convox Rack](https://docs.convox.com/introduction/rack) you wish to build against. ### `app` **Required** The name of the [app](https://docs.convox.com/deployment/creating-an-application) you wish to build. +### `cached` +**Optional** Whether to utilise the docker cache during the build. Defaults to true. + ## Outputs ### `release` The ID of the release that is created when the build completes. diff --git a/action.yml b/action.yml index 61e270f..eb750d0 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,10 @@ inputs: description: description: Convox build description required: false + cached: + description: Whether to utilise the docker cache during the build + required: false + default: true outputs: release: description: Release ID of the created build diff --git a/entrypoint.sh b/entrypoint.sh index f590936..e84f616 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,12 @@ #!/bin/sh echo "Building" export CONVOX_RACK=$INPUT_RACK -release=$(convox build --app $INPUT_APP --description "$INPUT_DESCRIPTION" --id) +if [ "$INPUT_CACHED" = "false" ]; then + release=$(convox build --app $INPUT_APP --description "$INPUT_DESCRIPTION" --id --no-cache) +else + release=$(convox build --app $INPUT_APP --description "$INPUT_DESCRIPTION" --id) +fi + if [ -z "$release" ] then echo "Build failed"