Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

update action add cache

aichy12687f96839e2f1
diff --git a/.github/workflows/build_dockerhub_img.yml b/.github/workflows/build_dockerhub_img.yml
index 91590174..dcd0e78f 100644
--- a/.github/workflows/build_dockerhub_img.yml
+++ b/.github/workflows/build_dockerhub_img.yml
@@ -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