Skip to content

Commit

Permalink
chore: try to use gha type for cache;
Browse files Browse the repository at this point in the history
  • Loading branch information
riandyrn committed Jul 19, 2023
1 parent 6e7a826 commit 8b29685
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,17 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: ./.output/tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build All Docker Images Necessary For Tests
run: |
docker buildx bake \
-f ./deploy/local/tests/docker-bake.json \
--set '*.cache-from'="type=local,src=./.output/tmp/.buildx-cache" \
--set '*.cache-to'="type=local,dest=./.output/tmp/.buildx-cache-new" \
--set '*.cache-from'="type=gha" \
--set '*.cache-to'="type=gha,mode=max" \
--load
- name: Run Automated Tests
run: make test

# This ugly bit is necessary if you don't want your cache to grow forever
# until it hits GitHub's limit of 5GB.
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf ./.output/tmp/.buildx-cache
mv ./.output/tmp/.buildx-cache-new ./.output/tmp/.buildx-cache
- name: Notify To Slack If Failed
uses: lazy-actions/slatify@v3.0.0
if: failure()
Expand Down

0 comments on commit 8b29685

Please sign in to comment.