From dfa3c83b033378fba8224ed5bb419aabdc867ef1 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Mon, 14 Apr 2025 09:47:36 +0200 Subject: [PATCH] Bootstrap inline shared workflow (only needed for docs-builder repo) --- .github/actions/bootstrap/action.yml | 2 +- .github/workflows/preview-build.yml | 29 +++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/actions/bootstrap/action.yml b/.github/actions/bootstrap/action.yml index a468540be..2fe53821c 100644 --- a/.github/actions/bootstrap/action.yml +++ b/.github/actions/bootstrap/action.yml @@ -13,7 +13,7 @@ outputs: runs: using: "composite" steps: - # Ensure we fetch all tags + # ensure we fetch all tags - shell: bash run: | git fetch --prune --unshallow --tags diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 8652aa21d..fc45e3b3a 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -74,12 +74,6 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.ref }} persist-credentials: false - - name: Free Disk Space - if: contains(fromJSON('["elastic/security-docs"]'), github.repository) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - - name: Create Deployment if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) || (steps.check-files.outputs.any_modified == 'true' && startsWith(github.event_name, 'pull_request')) uses: actions/github-script@v7 @@ -136,11 +130,28 @@ jobs: ;; esac - - name: Bootstrap Action Workspace + - name: 'Bootstrap docs-builder repo only: git' + shell: bash + if: github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result + run: | + git fetch --prune --unshallow --tags + git tag --list + + - name: 'Bootstrap docs-builder repo only: dotnet' + uses: actions/setup-dotnet@v4 if: github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result - uses: elastic/docs-builder/actions/bootstrap@main + with: + global-json-file: global.json + + - name: 'Bootstrap docs-builder repo only: npm' + uses: actions/setup-node@v4 + if: github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result + with: + cache: npm + cache-dependency-path: src/Elastic.Markdown/package-lock.json + node-version-file: .nvmrc - # we run our artifact directly please use the prebuild + # we run our artifact directly please use the prebuild # elastic/docs-builder@main GitHub Action for all other repositories! - name: Build documentation if: github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result