Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for running with --no-cache flag #7

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down