mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 12:15:47 -04:00
fix: always set cache-key-base during image build (#18168)
This commit is contained in:
parent
0cd5960007
commit
ff181cf346
6
.github/actions/image-build/action.yml
vendored
6
.github/actions/image-build/action.yml
vendored
@ -66,13 +66,13 @@ runs:
|
|||||||
SUFFIX: ${{ steps.cache-key-suffix.outputs.suffix }}
|
SUFFIX: ${{ steps.cache-key-suffix.outputs.suffix }}
|
||||||
PLATFORM_PAIR: ${{ steps.prepare.outputs.platform-pair }}
|
PLATFORM_PAIR: ${{ steps.prepare.outputs.platform-pair }}
|
||||||
run: |
|
run: |
|
||||||
|
HASH=$(sha256sum <<< "${BUILD_ARGS}" | cut -d' ' -f1)
|
||||||
|
CACHE_KEY="${PLATFORM_PAIR}-${HASH}"
|
||||||
|
echo "cache-key-base=${CACHE_KEY}" >> $GITHUB_OUTPUT
|
||||||
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then
|
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then
|
||||||
# Essentially just ignore the cache output (forks can't write to registry cache)
|
# Essentially just ignore the cache output (forks can't write to registry cache)
|
||||||
echo "cache-to=type=local,dest=/tmp/discard,ignore-error=true" >> $GITHUB_OUTPUT
|
echo "cache-to=type=local,dest=/tmp/discard,ignore-error=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
HASH=$(sha256sum <<< "${BUILD_ARGS}" | cut -d' ' -f1)
|
|
||||||
CACHE_KEY="${PLATFORM_PAIR}-${HASH}"
|
|
||||||
echo "cache-key-base=${CACHE_KEY}" >> $GITHUB_OUTPUT
|
|
||||||
echo "cache-to=type=registry,ref=${IMAGE}-build-cache:${CACHE_KEY}-${SUFFIX},mode=max,compression=zstd" >> $GITHUB_OUTPUT
|
echo "cache-to=type=registry,ref=${IMAGE}-build-cache:${CACHE_KEY}-${SUFFIX},mode=max,compression=zstd" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user