Skip to content

Commit d471320

Browse files
committed
RHOAIENG-21668: chore(gha): disable caching for subscribed builds
1 parent 4e70ca2 commit d471320

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,29 @@ jobs:
282282

283283
- name: "push|schedule|workflow_dispatch: make ${{ inputs.target }}"
284284
run: |
285+
set -Eeuxo pipefail
286+
# cache the build only if we are not using subscription
287+
if [[ ${{ inputs.subscription }} == "false" ]]; then
288+
export CONTAINER_BUILD_CACHE_ARGS="--cache-from ${{ env.CACHE }} --cache-to ${{ env.CACHE }}"
289+
fi
285290
make ${{ inputs.target }}
286291
if: ${{ fromJson(inputs.github).event_name == 'push' ||
287292
fromJson(inputs.github).event_name == 'schedule' ||
288293
fromJson(inputs.github).event_name == 'workflow_dispatch' }}
289294
env:
290295
IMAGE_TAG: "${{ steps.calculated_vars.outputs.IMAGE_TAG }}"
291-
CONTAINER_BUILD_CACHE_ARGS: "--cache-from ${{ env.CACHE }} --cache-to ${{ env.CACHE }}"
292296
- name: "pull_request: make ${{ inputs.target }}"
293297
run: |
298+
set -Eeuxo pipefail
299+
# cache the build only if we are not using subscription
300+
if [[ ${{ inputs.subscription }} == "false" ]]; then
301+
export CONTAINER_BUILD_CACHE_ARGS="--cache-from ${{ env.CACHE }}"
302+
fi
294303
make ${{ inputs.target }}
295304
if: "${{ fromJson(inputs.github).event_name == 'pull_request' ||
296305
fromJson(inputs.github).event_name == 'pull_request_target' }}"
297306
env:
298307
IMAGE_TAG: "${{ steps.calculated_vars.outputs.IMAGE_TAG }}"
299-
CONTAINER_BUILD_CACHE_ARGS: "--cache-from ${{ env.CACHE }}"
300308
# We don't have access to image registry, so disable pushing
301309
PUSH_IMAGES: "no"
302310

0 commit comments

Comments
 (0)