From c8a18518a7a4e14c3dbb85b2b45223ff2d371ed7 Mon Sep 17 00:00:00 2001 From: antifallobst Date: Thu, 12 Oct 2023 22:33:04 +0200 Subject: [PATCH] ci: added caching --- .gitea/workflows/deploy.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 7b33e74..8a49a7c 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -14,12 +14,27 @@ jobs: uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Cache Docker layers + uses: https://github.com/actions/cache@v3 + with: + path: | + /tmp/.buildx-cache.bookworm + /tmp/.buildx-cache.latest + key: ${{ runner.os }}-buildx-${{ gitea.sha }} + restore-keys: | + ${{ runner.os }}-buildx- - name: Build uses: docker/build-push-action@v5 with: context: . load: true tags: nerdcult_frontend:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new + - name: Rotate the cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: Deploy run: | docker stop nerdcult-frontend