From e7a492b202a41aa5b89356596b96985dd51c2573 Mon Sep 17 00:00:00 2001 From: Robert Detjens Date: Tue, 18 Jul 2023 12:05:00 -0700 Subject: [PATCH] cache Buildx layers in GH Actions cache for all builds --- .github/workflows/on_push.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index 895c3ffa..dcc90bc5 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -117,6 +117,8 @@ jobs: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} type=raw,value=stable,enable=${{ steps.get_tag_name.outputs.release || 'false' }} type=raw,value=${{ steps.get_tag_name.outputs.tag }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Build and push id: docker_build uses: docker/build-push-action@v4 @@ -130,6 +132,8 @@ jobs: GCLOUD_VERSION=${{ env.GCLOUD_VERSION }} KOMPOSE_VERSION=${{ env.KOMPOSE_VERSION }} tags: ${{ steps.meta.outputs.tags }} + cache-from: type=gha + cache-to: type=gha,mode=max publish_dockerhub_server: needs: test @@ -166,6 +170,8 @@ jobs: type=raw,value=latest-server,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} type=raw,value=stable-server,enable=${{ steps.get_tag_name.outputs.release || 'false' }} type=raw,value=${{ steps.get_tag_name.outputs.tag }}-server + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Build and push unfurl server id: docker_build_server uses: docker/build-push-action@v4 @@ -174,6 +180,8 @@ jobs: file: ./docker/Dockerfile.server push: true tags: ${{ steps.meta_server.outputs.tags }} + cache-from: type=gha + cache-to: type=gha,mode=max publish_dockerhub_podman: needs: publish_dockerhub @@ -210,6 +218,8 @@ jobs: type=raw,value=latest-podman,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} type=raw,value=stable-podman,enable=${{ steps.get_tag_name.outputs.release || 'false' }} type=raw,value=${{ steps.get_tag_name.outputs.tag }}-podman + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Build and push id: docker_build uses: docker/build-push-action@v4 @@ -224,6 +234,8 @@ jobs: KOMPOSE_VERSION=${{ env.KOMPOSE_VERSION }} UNFURL_TAG=${{ steps.get_tag_name.outputs.tag }} tags: ${{ steps.meta.outputs.tags }} + cache-from: type=gha + cache-to: type=gha,mode=max publish_pypi: needs: publish_dockerhub @@ -302,6 +314,9 @@ jobs: type=ref,event=tag type=raw,value=latest,enable={{is_default_branch}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build and push id: docker_build uses: docker/build-push-action@v4 @@ -315,3 +330,5 @@ jobs: GCLOUD_VERSION=${{ env.GCLOUD_VERSION }} KOMPOSE_VERSION=${{ env.KOMPOSE_VERSION }} tags: ${{ steps.meta.outputs.tags }} + cache-from: type=gha + cache-to: type=gha,mode=max