From 2b331cc43b9b42ef7664a3f51c3ed8b8a16d40ff Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Sun, 12 Nov 2023 19:26:53 +0000 Subject: [PATCH] feat(docker build): cache image and build steps to github actions cache (#17) * feat(docker build): cache image and build steps to registry cache * Configure buildx to enable docker cache --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 7533862..6bac12d 100644 --- a/action.yml +++ b/action.yml @@ -78,6 +78,8 @@ runs: echo "Setting the function's releaseTag to: ${RELEASE_TAG}" echo "releaseTag=${RELEASE_TAG}" >> "$GITHUB_ENV" + - name: Set up Docker Buildx # required to enable caching of docker build + uses: docker/setup-buildx-action@v2 - name: Log in to Speckle Automate Docker registry uses: docker/login-action@v3.0.0 with: @@ -108,6 +110,8 @@ runs: tags: ${{ env.automateHost }}/${{ inputs.speckle_function_id }}:${{ env.releaseTag }} target: '' push: true + cache-from: type=registry,ref=${{ env.automateHost }}/${{ inputs.speckle_function_id }}:buildcache + cache-to: type=registry,ref=${{ env.automateHost }}/${{ inputs.speckle_function_id }}:buildcache,mode=max - name: Speckle Automate function version publisher uses: specklesystems/speckle-automate-github-action@0.8.0 id: register_speckle_function_version