cache-from: type=gha

This commit is contained in:
严浩
2024-10-08 16:20:14 +08:00
parent 52f023ca9d
commit 1663c90c95

View File

@ -39,14 +39,14 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Cache Docker layers # - name: Cache Docker layers
uses: actions/cache@v4 # uses: actions/cache@v4
with: # with:
path: | # path: |
/tmp/.buildx-cache # /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }} # key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: | # restore-keys: |
${{ runner.os }}-buildx- # ${{ runner.os }}-buildx-
- name: Extract metadata - name: Extract metadata
id: meta id: meta
@ -78,12 +78,12 @@ jobs:
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
platforms: linux/amd64, linux/arm64 platforms: linux/amd64,linux/arm64
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
file: ./Dockerfile file: ./Dockerfile
# cache-from: type=gha cache-from: type=gha
# cache-to: type=gha,mode=max cache-to: type=gha,mode=max
cache-from: type=local,src=/tmp/.buildx-cache # cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache # cache-to: type=local,dest=/tmp/.buildx-cache