-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove build_img var, replace with omitting image_name var
- Loading branch information
1 parent
a3074ab
commit 141e015
Showing
1 changed file
with
6 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,10 @@ on: | |
workflow_call: | ||
inputs: | ||
image_name: | ||
description: "The image root name, without tag. E.g. 'ghcr.io/[dollar]{{ github.repository }}'" | ||
required: true | ||
type: string | ||
build_img: | ||
description: "If the image must be built first, or false to just pull." | ||
description: "The image root name to build, without tag. E.g. 'ghcr.io/[dollar]{{ github.repository }}'" | ||
required: false | ||
type: boolean | ||
default: true | ||
type: string | ||
default: "" | ||
build_context: | ||
description: "Root directory to start the build from." | ||
required: false | ||
|
@@ -95,7 +91,7 @@ jobs: | |
# Get cached images from previous runs (when running multiple times) | ||
check-img-cache: | ||
runs-on: ubuntu-latest | ||
if: ${{ inputs.build_img && inputs.cache_image }} | ||
if: ${{ inputs.image_name != '' && inputs.cache_image }} | ||
environment: | ||
name: ${{ inputs.environment }} | ||
outputs: | ||
|
@@ -107,12 +103,12 @@ jobs: | |
path: /tmp/images | ||
key: image-cache-${{ runner.os }} | ||
|
||
# Build the test image if required (unless `inputs.build_img: false`) | ||
# Build the test image if required (unless `inputs.image_name` is set) | ||
test-img-build: | ||
uses: hotosm/gh-workflows/.github/workflows/[email protected] | ||
needs: [check-img-cache] | ||
# Only build if no cached image is found | ||
if: ${{ inputs.build_img && needs.check-img-cache.outputs.cache-hit != 'true' }} | ||
if: ${{ inputs.image_name != '' && needs.check-img-cache.outputs.cache-hit != 'true' }} | ||
with: | ||
context: ${{ inputs.build_context }} | ||
dockerfile: ${{ inputs.build_dockerfile }} | ||
|