Skip to content

Commit

Permalink
Improve Docker CI Cache (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
PerezIgnacio authored Jan 20, 2025
1 parent 70d21b8 commit 69f0ff8
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,16 @@ 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: ${{ runner.os }}-buildx-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ github.head_ref || github.ref_name }}
${{ runner.os }}-buildx-main
${{ runner.os }}-buildx-
- name: Build prod Docker image
uses: docker/build-push-action@v6
with:
push: false
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
cache-from: |
type=gha,scope=${{ github.ref_name }}
type=gha,ref=main
cache-to: type=gha,scope=${{ github.ref_name }},mode=max
file: Dockerfile

- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
linters:
name: Linters
runs-on: ubuntu-latest
Expand Down

0 comments on commit 69f0ff8

Please sign in to comment.