Skip to content

Commit

Permalink
ci: used experimental gha cache type from building images
Browse files Browse the repository at this point in the history
Signed-off-by: Tomer Figenblat <[email protected]>
  • Loading branch information
TomerFi committed Feb 7, 2024
1 parent a4e71d7 commit a96c099
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,12 @@ jobs:
- name: Setup docker buildx
uses: docker/setup-buildx-action@v3

- name: Cache image layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-image-layers-${{ hashFiles('Dockerfile') }}

- name: Build image
uses: docker/build-push-action@v5
with:
tags: ${{ env.TESTING_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max
load: true

- name: Test image run
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ jobs:
- name: Setup docker buildx
uses: docker/setup-buildx-action@v3

- name: Cache image layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-image-layers-${{ hashFiles('Dockerfile') }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -115,6 +109,6 @@ jobs:
tags: |
tomerfi/version-bumper:latest
tomerfi/version-bumper:${{ steps.bump.outputs.version }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max
labels: ${{ steps.meta.outputs.labels }}
10 changes: 2 additions & 8 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,11 @@ jobs:
- name: Setup docker buildx
uses: docker/setup-buildx-action@v3

- name: Cache image layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-image-layers-${{ hashFiles('Dockerfile') }}

- name: Build image
uses: docker/build-push-action@v5
with:
tags: tomerfi/version-bumper:staging
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max
load: true

0 comments on commit a96c099

Please sign in to comment.