diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index bba785c8..e0ee70b4 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -25,8 +25,6 @@ jobs: docker-buildx: if: github.repository == 'itzg/docker-minecraft-server' runs-on: ubuntu-20.04 - env: - CACHE_NAME: java11 steps: - name: Checkout uses: actions/checkout@v2.3.4 @@ -42,7 +40,7 @@ jobs: type=ref,event=tag type=edge,branch=master flavor: | - latest=false + latest=true - name: Setup Docker Buildx uses: docker/setup-buildx-action@v1 @@ -51,9 +49,8 @@ jobs: uses: actions/cache@v2.1.6 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}- ${{ runner.os }}-buildx- - name: Set up QEMU @@ -76,8 +73,16 @@ jobs: # ensure latest base image is used pull: true cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new labels: ${{ steps.meta.outputs.labels }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bd715089..c5de7394 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,8 +29,6 @@ jobs: needs: - test runs-on: ubuntu-20.04 - env: - CACHE_NAME: master steps: - uses: actions/checkout@v2.3.4 @@ -51,9 +49,7 @@ jobs: fi TAGS="${DOCKER_IMAGE}:${VERSION//\//-}" echo ::set-output name=tags::${TAGS} - echo ::set-output name=cache_from::${TAGS} echo ::set-output name=version::${VERSION//\//-} - echo ::set-output name=cache_version::${VERSION//\//-} - name: Setup Docker Buildx uses: docker/setup-buildx-action@v1 @@ -62,9 +58,8 @@ jobs: uses: actions/cache@v2.1.6 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}- ${{ runner.os }}-buildx- - name: Login to DockerHub @@ -86,7 +81,7 @@ jobs: # tags determined by prep step tags: ${{ steps.prep.outputs.tags }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new labels: | org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server org.opencontainers.image.version=${{ steps.prep.outputs.version }} @@ -95,3 +90,11 @@ jobs: - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} + + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache