From 489551aab32f67807a4074d9c8bb069a01ccc3bc Mon Sep 17 00:00:00 2001 From: Collin Heist Date: Mon, 20 Nov 2023 23:07:32 -0700 Subject: [PATCH] Improve and simplify caching --- .github/workflows/develop.yml | 17 ++--------------- .github/workflows/latest.yml | 17 ++--------------- .github/workflows/nightly.yml | 17 ++--------------- 3 files changed, 6 insertions(+), 45 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 9034d45a..7e2b488e 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -21,14 +21,6 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -51,13 +43,8 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: ${{ secrets.DOCKER_HUB_USERNAME }}/plex-meta-manager:develop - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new - - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + cache-from: type=gha + cache-to: type=gha,mode=max - name: Send Discord Commit Notification uses: meisnate12/discord-notifications@master diff --git a/.github/workflows/latest.yml b/.github/workflows/latest.yml index 5c6e5af9..c320bf03 100644 --- a/.github/workflows/latest.yml +++ b/.github/workflows/latest.yml @@ -17,14 +17,6 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -45,13 +37,8 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: ${{ secrets.DOCKER_HUB_USERNAME }}/plex-meta-manager:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new - - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + cache-from: type=gha + cache-to: type=gha,mode=max - name: Discord Success Notification uses: meisnate12/discord-notifications@master diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7cc6f443..56641304 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,14 +21,6 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -51,13 +43,8 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: ${{ secrets.DOCKER_HUB_USERNAME }}/plex-meta-manager:nightly - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new - - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + cache-from: type=gha + cache-to: type=gha,mode=max - name: Send Discord Commit Notification uses: meisnate12/discord-notifications@master