add cache for docker buildx

This commit is contained in:
smf
2024-04-12 16:09:13 +08:00
parent a171b5509b
commit e1b1dda1ff

View File

@@ -78,6 +78,14 @@ jobs:
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
type=semver,pattern=v{{major}} type=semver,pattern=v{{major}}
- name: Cache docker buildx main
uses: actions/cache@v4
with:
path: /tmp/.buildx-main-cache
key: ${{ runner.os }}-buildx-main-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-main-
- name: Build and push - name: Build and push
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:
@@ -92,3 +100,5 @@ jobs:
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-main-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-main-cache