First attempt at caching the image builds

This commit is contained in:
Roland Geider
2023-07-11 21:15:03 +02:00
parent d91e32c46d
commit 1445d14ccb

View File

@@ -71,6 +71,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.9.0
with:
install: true
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: multi-buildx-${{ matrix.platform }}-${{ hashFiles('requirements*.txt') }}
restore-keys: |
multi-buildx-${{ matrix.platform }}
- name: Login to Docker Hub
uses: docker/login-action@v2.2.0
@@ -87,6 +97,10 @@ jobs:
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=local,src=/tmp/.buildx-cache
# 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: |
@@ -102,6 +116,11 @@ jobs:
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: