Skip to content

Commit

Permalink
Test changing cache type
Browse files Browse the repository at this point in the history
  • Loading branch information
PerezIgnacio committed Dec 9, 2024
1 parent 880e1f4 commit 35b4ef2
Showing 1 changed file with 8 additions and 42 deletions.
50 changes: 8 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,55 +26,30 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.prod-buildx-cache
key: prod-${{ runner.os }}-buildx-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
restore-keys: |
prod-${{ runner.os }}-buildx-${{ github.head_ref || github.ref_name }}
prod-${{ runner.os }}-buildx-main
prod-${{ runner.os }}-buildx-
- name: Build prod Docker image
uses: docker/build-push-action@v6
with:
push: false
cache-from: type=local,src=/tmp/.prod-buildx-cache
cache-to: type=local,dest=/tmp/.prod-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/.prod-buildx-cache
mv /tmp/.prod-buildx-cache-new /tmp/.prod-buildx-cache
docker:
runs-on: ubuntu-latest
steps:
- 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 and export
uses: docker/build-push-action@v6
with:
push: false
tags: api_base/test:latest
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
outputs: type=docker,dest=/tmp/api_base_test_image.tar
file: Dockerfile.dev

Expand All @@ -84,15 +59,6 @@ jobs:
name: api base test image
path: /tmp/api_base_test_image.tar
retention-days: 1

- # 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 35b4ef2

Please sign in to comment.