Skip to content

Commit

Permalink
fix: Use registry cache type instead of gha
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Mar 22, 2024
1 parent 816d1d6 commit 95cc9e6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
strategy:
matrix:
package: [web, workers]
platform: [linux/amd64, linux/arm64]
runs-on: ubuntu-latest
permissions:
packages: write
Expand All @@ -35,11 +34,11 @@ jobs:
context: .
file: docker/Dockerfile
target: ${{ matrix.package }}
platforms: ${{ matrix.platform }}
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/mohamedbassem/hoarder-${{ matrix.package }}:latest
cache-from: type=gha,scope=${{ matrix.package }}-${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=${{ matrix.package }}-${{ matrix.platform }}
cache-from: type=registry,ref=ghcr.io/mohamedbassem/hoarder-build-cache:${{ matrix.package }}
cache-to: type=registry,mode=max,ref=ghcr.io/mohamedbassem/hoarder-build-cache:${{ matrix.package }}

- name: Build ${{ matrix.package }} (release)
uses: docker/build-push-action@v5
Expand All @@ -48,8 +47,8 @@ jobs:
context: .
file: docker/Dockerfile
target: ${{ matrix.package }}
platforms: ${{ matrix.platform }}
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/mohamedbassem/hoarder-${{ matrix.package }}:${{github.event.release.name}},ghcr.io/mohamedbassem/hoarder-${{ matrix.package }}:release
cache-from: type=gha,scope=${{ matrix.package }}-${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=${{ matrix.package }}-${{ matrix.platform }}
cache-from: type=registry,ref=ghcr.io/mohamedbassem/hoarder-build-cache:${{ matrix.package }}
cache-to: type=registry,mode=max,ref=ghcr.io/mohamedbassem/hoarder-build-cache:${{ matrix.package }}

0 comments on commit 95cc9e6

Please sign in to comment.