Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
chore: Docker CI add cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ziteh committed Oct 3, 2024
1 parent c1be300 commit c2ef056
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,33 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Print Docker version
run: docker version
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
run: docker build -t hie:${{ github.sha }} .
- name: Build and push
uses: docker/build-push-action@v6
with:
push: false
load: true
tags: hie:${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- # 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
- name: Save Docker image
run: docker save hie:${{ github.sha }} -o hie_${{ github.sha }}.tar
Expand Down

0 comments on commit c2ef056

Please sign in to comment.