diff --git a/.github/workflows/respond-to-cubic-dev-ai.yml b/.github/workflows/respond-to-cubic-dev-ai.yml index f2dbe0c47..b5e0d4a79 100644 --- a/.github/workflows/respond-to-cubic-dev-ai.yml +++ b/.github/workflows/respond-to-cubic-dev-ai.yml @@ -60,12 +60,28 @@ jobs: node-version: "20" cache: "npm" - - name: Install dependencies and build CLI + - name: Cache build output if: steps.check-mention.outputs.contains_mention == 'true' + id: cache-build + uses: actions/cache@v4 + with: + path: | + dist/ + node_modules/ + key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json', 'src/**/*', 'tsconfig*.json') }} + restore-keys: | + ${{ runner.os }}-build- + + - name: Install dependencies and build CLI + if: steps.check-mention.outputs.contains_mention == 'true' && steps.cache-build.outputs.cache-hit != 'true' run: | npm ci npm run build + - name: Install dependencies only (cache hit) + if: steps.check-mention.outputs.contains_mention == 'true' && steps.cache-build.outputs.cache-hit == 'true' + run: npm ci --prefer-offline + - name: Start remote session if: steps.check-mention.outputs.contains_mention == 'true' id: remote-session