update action add cache

This commit is contained in:
aichy126 2023-02-07 15:08:52 +08:00
parent 6cda84d350
commit 87f96839e2
1 changed files with 16 additions and 1 deletions

View File

@ -21,7 +21,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: aichy66/actiondev
images: answerdev/answer
tags: |
type=raw,value=latest
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
@ -33,6 +33,14 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
with:
@ -54,6 +62,13 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache