From fab40affb7a1d2bab9ff7ff97c09f956e8dfade1 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Tue, 16 May 2023 11:39:58 +0200 Subject: [PATCH] Use caches to share layers --- .github/workflows/deploy.yaml | 3 +++ .github/workflows/test.yaml | 27 ++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 67045e9..f6c2024 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -39,6 +39,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | WINE_FLAVOUR=stable + cache-to: type=local,dest=/tmp/buildx-cache,mode=max - name: Build devel uses: docker/build-push-action@v4 @@ -48,6 +49,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | WINE_FLAVOUR=devel + cache-from: type=local,src=/tmp/buildx-cache - name: Build staging uses: docker/build-push-action@v4 @@ -57,3 +59,4 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | WINE_FLAVOUR=staging + cache-from: type=local,src=/tmp/buildx-cache diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 99bd170..2eff4f8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,11 +1,36 @@ +--- name: Test Docker image on: - pull_request +permissions: + contents: read + jobs: build: name: Build Docker image runs-on: ubuntu-latest steps: - - name: Build image + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build stable + uses: docker/build-push-action@v4 + with: + build-args: | + WINE_FLAVOUR=stable + cache-to: type=local,dest=/tmp/buildx-cache,mode=max + + - name: Build devel + uses: docker/build-push-action@v4 + with: + build-args: | + WINE_FLAVOUR=devel + cache-from: type=local,src=/tmp/buildx-cache + + - name: Build staging uses: docker/build-push-action@v4 + with: + build-args: | + WINE_FLAVOUR=staging + cache-from: type=local,src=/tmp/buildx-cache