From 224ef843e4eab779ff3f6f56bf4db96decadcd73 Mon Sep 17 00:00:00 2001 From: Daniel Gak Anagrov Date: Thu, 12 Jun 2025 11:21:45 +0200 Subject: [PATCH] feat(ci): improved caching around frontend2 builds (#4930) * fix: removed build arg for frontend2 * feat(ci): separated builds for frontend2 --- .github/workflows/builds.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 410972a26..42e1850fe 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -46,14 +46,24 @@ jobs: with: username: ${{ inputs.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push + - name: Build and push w/ version tag uses: useblacksmith/build-push-action@v1 + if: ${{ inputs.PUSH_IMAGES }} with: - push: ${{ inputs.PUSH_IMAGES }} + push: true tags: speckle/speckle-frontend-2:${{ inputs.IMAGE_VERSION_TAG }} file: ./packages/frontend-2/Dockerfile build-args: | SPECKLE_SERVER_VERSION=${{ inputs.IMAGE_VERSION_TAG }} + cache-from: type=registry,ref=speckle/speckle-frontend-2:buildcache + cache-to: type=registry,ref=speckle/speckle-frontend-2:buildcache,mode=max + - name: Check frontend-2 build + uses: useblacksmith/build-push-action@v1 + if: ${{ inputs.PUSH_IMAGES == false }} + with: + push: false + tags: speckle/speckle-frontend-2:${{ inputs.IMAGE_VERSION_TAG }} + file: ./packages/frontend-2/Dockerfile docker-build-preview-service: runs-on: blacksmith @@ -166,5 +176,7 @@ jobs: - uses: useblacksmith/build-push-action@v1 with: setup-only: true + cache-from: type=registry,ref=speckle/speckle-frontend-2:buildcache-sourcemaps + cache-to: type=registry,ref=speckle/speckle-frontend-2:buildcache-sourcemaps - name: Build and Publish sourcemaps run: ./.github/workflows/scripts/publish_fe2_sourcemaps.sh