Skip to content

Commit

Permalink
feat: add cache layer to docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter committed Dec 19, 2024
1 parent 268176c commit a9b9ad4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build-push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,23 @@ jobs:
- 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: buildx-cache-${{ github.sha }}
restore-keys: |
buildx-cache-
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
platforms: ${{ matrix.platform }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/era-test-node:${{ steps.docker_tag.outputs.tag }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/era-test-node:latest
Expand Down

0 comments on commit a9b9ad4

Please sign in to comment.