Skip to content

Commit

Permalink
attempting to create different caches for each platform
Browse files Browse the repository at this point in the history
  • Loading branch information
realkaranvir committed Dec 8, 2024
1 parent 5634559 commit 8a7e751
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
build_and_push_docker_image:
name: Push Docker Image to Docker Hub
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux/amd64, linux/arm64]

steps:
- name: Checkout Repository
Expand All @@ -32,9 +35,9 @@ jobs:
path: |
root/.ivy2
root/.sbt
key: sbt-${{ runner.os }}-${{ hashFiles('**/build.sbt', '**/project/*.sbt') }}
key: sbt-${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('**/build.sbt', '**/project/*.sbt') }}
restore-keys: |
sbt-${{ runner.os }}-
sbt-${{ runner.os }}-${{ matrix.platform }}
- name: Inject sbt cache into Docker
uses: reproducible-containers/[email protected]
Expand All @@ -50,6 +53,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}
Expand Down

0 comments on commit 8a7e751

Please sign in to comment.