diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a282a45f..f70a20bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,55 +26,30 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.prod-buildx-cache - key: prod-${{ runner.os }}-buildx-${{ github.head_ref || github.ref_name }}-${{ github.sha }} - restore-keys: | - prod-${{ runner.os }}-buildx-${{ github.head_ref || github.ref_name }} - prod-${{ runner.os }}-buildx-main - prod-${{ runner.os }}-buildx- - - name: Build prod Docker image uses: docker/build-push-action@v6 with: push: false - cache-from: type=local,src=/tmp/.prod-buildx-cache - cache-to: type=local,dest=/tmp/.prod-buildx-cache-new,mode=max + cache-from: | + type=gha,scope=${{ github.ref_name }} + type=gha,ref=main + cache-to: type=gha,scope=${{ github.ref_name }},mode=max file: Dockerfile - - - # 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/.prod-buildx-cache - mv /tmp/.prod-buildx-cache-new /tmp/.prod-buildx-cache - docker: runs-on: ubuntu-latest steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.head_ref || github.ref_name }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx-${{ github.head_ref || github.ref_name }} - ${{ runner.os }}-buildx-main - ${{ runner.os }}-buildx- - - name: Build and export uses: docker/build-push-action@v6 with: push: false tags: api_base/test:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + cache-from: | + type=gha,scope=${{ github.ref_name }} + type=gha,ref=main + cache-to: type=gha,scope=${{ github.ref_name }},mode=max outputs: type=docker,dest=/tmp/api_base_test_image.tar file: Dockerfile.dev @@ -84,15 +59,6 @@ jobs: name: api base test image path: /tmp/api_base_test_image.tar retention-days: 1 - - - # 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 - linters: name: Linters runs-on: ubuntu-latest