mirror of
https://github.com/wger-project/wger.git
synced 2026-02-18 00:17:51 +01:00
First attempt at caching the image builds
This commit is contained in:
19
.github/workflows/docker.yml
vendored
19
.github/workflows/docker.yml
vendored
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user