Skip to content

Commit e4c8380

Browse files
committed
RHOAIENG-21668: chore(gha): disable caching for subscribed builds
1 parent 4491157 commit e4c8380

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
@@ -281,21 +281,29 @@ jobs:
281281

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

0 commit comments

Comments
 (0)