From 7a411e63c819251de4cc5c38936b7983bb39bf6c Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Wed, 19 Jul 2023 19:38:14 -0700 Subject: [PATCH] ci: cache container images to GitHub Actions cache --- .github/workflows/linux.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b4c4a4d0..184a9599 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -60,9 +60,26 @@ jobs: with: python-version: '3.11' + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Generate Dockerfiles + run: | + ./build-linux.py --make-target empty + - name: Build Image + uses: docker/build-push-action@v4 + with: + file: build/${{ matrix.image }}.Dockerfile + cache-from: | + type=gha + cache-to: | + type=gha + outputs: | + type=tar,dest=build/image-${{ matrix.image }}.tar + + - name: Compress Image run: | - ./build-linux.py --make-target toolchain-image-${{ matrix.image }} zstd -v -T0 -6 --rm build/image-*.tar - name: Upload Docker Image