Skip to content

Commit

Permalink
Cache docker layers in CI build (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
kentbull authored Dec 19, 2023
1 parent f31296a commit d87bccc
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/publish-keria.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v2
Expand All @@ -26,6 +26,18 @@ jobs:
with:
images: WebOfTrust/keria

- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker Layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: keri-${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
keri-${{ runner.os }}-buildx-
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
Expand All @@ -35,4 +47,11 @@ jobs:
tags: |
WebOfTrust/keria:${{ github.event.inputs.version }}
WebOfTrust/keria:latest
labels: ${{ github.event.inputs.version }}
labels: ${{ github.event.inputs.version }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move Docker cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

0 comments on commit d87bccc

Please sign in to comment.