Skip to content

Commit 83deb7e

Browse files
committed
RHOAIENG-21668: chore(gha): disable caching for subscribed builds
1 parent 2a7966a commit 83deb7e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

+10-2
Original file line numberDiff line numberDiff line change
@@ -283,21 +283,29 @@ jobs:
283283

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

0 commit comments

Comments
 (0)