Add docker layer caching

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
Mark Sagi-Kazar 2020-11-05 14:24:35 +01:00
parent 5cc8b562ec
commit 10ac93d42b
No known key found for this signature in database
GPG key ID: 34CC109EB5ED1C2A

View file

@ -139,6 +139,14 @@ jobs:
# TODO: Remove driver-opts once fix is released docker/buildx#386 # TODO: Remove driver-opts once fix is released docker/buildx#386
driver-opts: image=moby/buildkit:master driver-opts: image=moby/buildkit:master
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
@ -161,6 +169,8 @@ jobs:
platforms: linux/amd64,linux/arm/v7,linux/arm64 platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name == 'push' }} push: ${{ github.event_name == 'push' }}
tags: ${{ steps.tags.outputs.tags }} tags: ${{ steps.tags.outputs.tags }}
cache-from: type=local,mode=max,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
build-args: | build-args: |
VERSION=${{ steps.tags.outputs.version }} VERSION=${{ steps.tags.outputs.version }}
COMMIT_HASH=${{ steps.tags.outputs.commit_hash }} COMMIT_HASH=${{ steps.tags.outputs.commit_hash }}