From 4b76e7908354ab2744e0f86d9aa8df37534ea7a8 Mon Sep 17 00:00:00 2001 From: Ed Fricker Date: Fri, 17 Mar 2023 14:35:09 +0000 Subject: [PATCH] Allow for running with --no-cache flag --- README.md | 2 ++ action.yml | 4 ++++ entrypoint.sh | 10 +++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 05d59a2..70370c2 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ The Deploy action performs the functions of combining the [Build](https://github **Required** The value of your [Convox Deploy Key](https://docs.convox.com/console/deploy-keys) ### `host` **Optional** The host name of your [Convox Console](https://docs.convox.com/introduction/console). This defaults to `console.convox.com` and only needs to be overwritten if you have a [self-hosted console](https://docs.convox.com/reference/hipaa-compliance#run-a-private-convox-console) +### `cached` +**Optional** Whether to utilise the docker cache during the build. Defaults to true. ## Example Usage diff --git a/action.yml b/action.yml index 8df38cd..cd5b916 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,10 @@ inputs: description: description: Convox build description required: false + cached: + description: Whether to utilise the docker cache during the build + required: false + default: true runs: using: docker image: Dockerfile \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 3eeae70..75653e4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,11 +2,15 @@ echo "Deploying" if [ -n "$INPUT_PASSWORD" ] then - export CONVOX_PASSWORD=$INPUT_PASSWORD + export CONVOX_PASSWORD=$INPUT_PASSWORD fi if [ -n "$INPUT_HOST" ] then - export CONVOX_HOST=$INPUT_HOST + export CONVOX_HOST=$INPUT_HOST fi export CONVOX_RACK=$INPUT_RACK -convox deploy --app $INPUT_APP --description "$INPUT_DESCRIPTION" --wait +if [ "$INPUT_CACHED" = "false" ]; then + convox deploy --app $INPUT_APP --description "$INPUT_DESCRIPTION" --no-cache --wait +else + convox deploy --app $INPUT_APP --description "$INPUT_DESCRIPTION" --wait +fi