From 420c2c1afddac59e46a5cc43be3c3526d29b1e60 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Wed, 23 Oct 2024 22:29:03 -0400 Subject: [PATCH] feat: buildx build caching --- .github/workflows/main.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab8dd4264..5ed5a97e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,7 @@ concurrency: jobs: release-please: + if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest permissions: contents: write @@ -44,13 +45,10 @@ jobs: - name: Build with Buildx uses: docker/setup-buildx-action@v3 with: - context: . - cache-from: type=gha - cache-to: type=gha,mode=max install: true platforms: linux/amd64 - name: Build Builder Image - run: docker buildx build -t builder -f ./Dockerfile . + run: docker buildx build --cache-from=type=gha --cache-to=type=gha,mode=max -t builder -f ./Dockerfile . lint-api: needs: [build-register-container] @@ -71,7 +69,7 @@ jobs: install: true platforms: linux/amd64 - name: Build Builder Image - run: docker buildx build -t builder -f ./Dockerfile . + run: docker buildx build --cache-from=type=gha -t builder -f ./Dockerfile . - name: Lint inside of the docker container run: | @@ -96,7 +94,7 @@ jobs: install: true platforms: linux/amd64 - name: Build Builder Image - run: docker buildx build -t builder -f ./Dockerfile . + run: docker buildx build --cache-from=type=gha -t builder -f ./Dockerfile . - name: Test inside of the docker container run: | docker run --rm builder npm run coverage @@ -155,7 +153,7 @@ jobs: install: true platforms: linux/amd64 - name: Build Builder Image - run: docker buildx build -t builder -f ./Dockerfile . + run: docker buildx build --cache-from=type=gha -t builder -f ./Dockerfile . - name: Build inside of the docker container id: build-pack-binary run: |