Skip to content

Commit d52902f

Browse files
committed
Add buildx example with cache
Signed-off-by: Mark Sagi-Kazar <[email protected]>
1 parent 84481ef commit d52902f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/dockerimage.yml

+17
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,20 @@ jobs:
6666
- run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/build-cache-no-buildkit || true
6767
- run: docker build . -t thing --cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/build-cache-no-buildkit
6868
- run: docker tag thing docker.pkg.github.com/$GITHUB_REPOSITORY/build-cache-no-buildkit && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/build-cache-no-buildkit || true
69+
build_cache_buildx:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v2
73+
- uses: docker/setup-buildx-action@v1
74+
- uses: actions/cache@v2
75+
with:
76+
path: /tmp/.buildx-cache
77+
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
78+
restore-keys: |
79+
${{ runner.os }}-buildx-
80+
- uses: docker/build-push-action@v2
81+
with:
82+
push: false
83+
tags: thing
84+
cache-from: type=local,src=/tmp/.buildx-cache
85+
cache-to: type=local,dest=/tmp/.buildx-cache

0 commit comments

Comments
 (0)