mirror of
https://github.com/jhbruhn/ics-adapter.git
synced 2025-03-14 19:15:50 +00:00
Add build caching
This commit is contained in:
parent
8aa0ce996a
commit
8f66bcdc8c
1 changed files with 18 additions and 0 deletions
18
.github/workflows/release.yaml
vendored
18
.github/workflows/release.yaml
vendored
|
@ -28,6 +28,7 @@ jobs:
|
|||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
@ -41,6 +42,14 @@ jobs:
|
|||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Cache Docker layers
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-multi-buildx
|
||||
-
|
||||
name: Build and push by digest
|
||||
id: build
|
||||
|
@ -51,6 +60,11 @@ jobs:
|
|||
#tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
# Note the mode=max here
|
||||
# More: https://github.com/moby/buildkit#--export-cache-options
|
||||
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue
|
||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
|
||||
-
|
||||
name: Export digest
|
||||
run: |
|
||||
|
@ -65,6 +79,10 @@ jobs:
|
|||
path: /tmp/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
- name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
|
|
Loading…
Reference in a new issue