-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into kvv-search-by-partial-path
- Loading branch information
Showing
51 changed files
with
1,354 additions
and
1,320 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,7 +145,6 @@ jobs: | |
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
# Skip when PR from a fork | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
with: | ||
registry: ghcr.io | ||
|
@@ -160,21 +159,29 @@ jobs: | |
echo "CACHE_KEY_SUFFIX=$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV | ||
fi | ||
- name: Generate cache target | ||
id: cache-target | ||
run: | | ||
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then | ||
# 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 | ||
else | ||
echo "cache-to=type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-${{ env.CACHE_KEY_SUFFIX }},mode=max,compression=zstd" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Build and push image | ||
id: build | ||
uses: docker/[email protected] | ||
with: | ||
context: ${{ env.context }} | ||
file: ${{ env.file }} | ||
platforms: ${{ matrix.platforms }} | ||
# Skip pushing when PR from a fork | ||
push: ${{ !github.event.pull_request.head.repo.fork }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
cache-to: type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-${{ env.CACHE_KEY_SUFFIX }},mode=max,compression=zstd | ||
cache-to: ${{ steps.cache-target.outputs.cache-to }} | ||
cache-from: | | ||
type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-${{ env.CACHE_KEY_SUFFIX }} | ||
type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-main | ||
outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true | ||
outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=${{ !github.event.pull_request.head.repo.fork }} | ||
build-args: | | ||
DEVICE=${{ matrix.device }} | ||
BUILD_ID=${{ github.run_id }} | ||
|
@@ -299,7 +306,6 @@ jobs: | |
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
# Skip when PR from a fork | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
with: | ||
registry: ghcr.io | ||
|
@@ -314,21 +320,29 @@ jobs: | |
echo "CACHE_KEY_SUFFIX=$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV | ||
fi | ||
- name: Generate cache target | ||
id: cache-target | ||
run: | | ||
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then | ||
# 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 | ||
else | ||
echo "cache-to=type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ matrix.device }}-${{ env.CACHE_KEY_SUFFIX }},mode=max,compression=zstd" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Build and push image | ||
id: build | ||
uses: docker/[email protected] | ||
with: | ||
context: ${{ env.context }} | ||
file: ${{ env.file }} | ||
platforms: ${{ matrix.platform }} | ||
# Skip pushing when PR from a fork | ||
push: ${{ !github.event.pull_request.head.repo.fork }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
cache-to: type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ env.CACHE_KEY_SUFFIX }},mode=max,compression=zstd | ||
cache-to: ${{ steps.cache-target.outputs.cache-to }} | ||
cache-from: | | ||
type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-${{ env.CACHE_KEY_SUFFIX }} | ||
type=registry,ref=${{ env.GHCR_REPO }}-build-cache:${{ env.PLATFORM_PAIR }}-main | ||
outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true | ||
outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=${{ !github.event.pull_request.head.repo.fork }} | ||
build-args: | | ||
DEVICE=cpu | ||
BUILD_ID=${{ github.run_id }} | ||
|
Oops, something went wrong.