Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

First attempt at caching the image builds

Roland Geider1445d14ccbb7
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 68f21f9bd..f35069c0b 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -71,6 +71,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/[email protected]
+ 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/[email protected]
@@ -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: