From df853930014306cb6323bcb2972f23ad3826786f Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Sun, 13 Jun 2021 12:59:40 +0100 Subject: [PATCH] feat: add `ignore-actions-cache` secret By default, a workflow re-run reuses the dev-generic GitHub Actions cache created by the previous attempt. The `ignore-actions-cache` secret acts as a flag for ignoring the former cache. PR: zmkfirmware/zmk-docker#76 --- .github/workflows/containers.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 09a6394..cfb6307 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -5,6 +5,7 @@ env: zephyr-sdk-version: 0.11.4 sha-abbrev-length: 12 no-cache: ${{ secrets.NO_CACHE != null || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} + ignore-actions-cache: ${{ secrets.IGNORE_ACTIONS_CACHE != null }} run-unit-tests: ${{ secrets.RUN_UNIT_TESTS != null }} docker-hub-credentials: ${{ secrets.DOCKER_HUB_USERNAME != null && secrets.DOCKER_HUB_TOKEN != null }} ghcr-credentials: ${{ secrets.GHCR_USERNAME != null && secrets.GHCR_TOKEN != null }} @@ -149,7 +150,7 @@ jobs: ZEPHYR_VERSION=${{ env.zephyr-version }} no-cache: ${{ env.no-cache == 'true' }} cache-from: | - type=local,src=${{ steps.paths.outputs.local }} + ${{ (env.ignore-actions-cache == 'false') && format('type=local,src={0}', steps.paths.outputs.local) || '' }} type=registry,ref=${{ steps.paths.outputs.branch }} ${{ (steps.paths.outputs.base != '') && format('type=registry,ref={0}', steps.paths.outputs.base) || '' }} type=registry,ref=${{ steps.paths.outputs.major-minor-branch }}