Skip to content

Commit 98af796

Browse files
committed
optional cache-to/from
1 parent 21f390a commit 98af796

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/build-docker-image.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66
image:
77
required: true
88
type: string
9-
cache-from-tag:
9+
cache-from:
1010
required: false
1111
type: string
12-
cache-to-tag:
12+
cache-to:
1313
required: false
1414
type: string
1515

@@ -71,8 +71,8 @@ jobs:
7171
tags: ${{ env.REGISTRY_IMAGE }}
7272
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
7373
# ${{ github.repository }} isn't lowercase so manually specify
74-
cache-from: type=registry,ref=ghcr.io/cwfmf/firestarr-cpp/cache:${{ env.PLATFORM_PAIR }}${{ inputs.cache-from-tag || '' }}
75-
cache-to: type=registry,mode=max,ref=ghcr.io/cwfmf/firestarr-cpp/cache:${{ env.PLATFORM_PAIR }}${{ inputs.cache-to-tag || '' }}
74+
cache-from: ${{ inputs.cache-from }}${{ case ( '' != inputs.cache-from, env.PLATFORM_PAIR, '' ) }}
75+
cache-to: ${{ inputs.cache-to }}${{ case ( '' != inputs.cache-to, env.PLATFORM_PAIR, '' ) }}
7676

7777
- name: Export digest
7878
run: |

.github/workflows/build-docker.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ jobs:
1111
uses: ./.github/workflows/build-docker-image.yml
1212
with:
1313
image: firestarr
14+
cache-from: type=registry,ref=ghcr.io/cwfmf/firestarr-cpp/cache
15+
cache-to: type=registry,mode=max,ref=ghcr.io/cwfmf/firestarr-cpp/cache
1416

1517
build-docker-minimal:
1618
needs: [build-docker-normal]
1719
uses: ./.github/workflows/build-docker-image.yml
1820
with:
1921
image: firestarr-minimal
20-
# HACK: this is just to prevent overwriting cache for others or figuring out how to not cache
21-
cache-to-tag: "-minimal"
22+
cache-from: type=registry,ref=ghcr.io/cwfmf/firestarr-cpp/cache
2223

2324
cleanup-docker-cache:
2425
needs: [build-docker-minimal]

0 commit comments

Comments
 (0)