Skip to content

Commit 594d312

Browse files
authored
Fix CI PMS Docker image caching (#1519)
* Fix docker digest in CI workflow * Always cache PMS Docker image
1 parent 6c6388a commit 594d312

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ jobs:
129129
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
130130
--header "Authorization: Bearer $token" \
131131
"https://registry-1.docker.io/v2/${{ env.PLEX_CONTAINER }}/manifests/${{ env.PLEX_CONTAINER_TAG }}" \
132-
| jq -r '.config.digest')
132+
| sha256sum | head -c 64)
133133
echo "Digest: $digest"
134134
echo "digest=$digest" >> $GITHUB_OUTPUT
135135
136-
- name: Cache PMS Docker image
136+
- name: Restore cached PMS Docker image
137137
id: docker-cache
138-
uses: actions/cache@v4
138+
uses: actions/cache/restore@v4
139139
with:
140140
path: ~/.cache/docker/plexinc
141141
key: ${{ runner.os }}-docker-pms-${{ steps.docker-digest.outputs.digest }}
@@ -208,6 +208,12 @@ jobs:
208208
name: coverage-${{ matrix.plex }}-${{ steps.python.outputs.python-version }}
209209
path: .coverage
210210

211+
- name: Save PMS Docker image cache
212+
if: always() && steps.docker-cache.outputs.cache-hit != 'true'
213+
uses: actions/cache/save@v4
214+
with:
215+
key: ${{ steps.docker-cache.outputs.cache-primary-key }}
216+
path: ~/.cache/docker/plexinc
211217

212218
coverage:
213219
name: Process test coverage (${{ matrix.plex }})

0 commit comments

Comments
 (0)