From d9dec22bd57de8b32b075c8eac1a90f017e94d38 Mon Sep 17 00:00:00 2001 From: Katie Hughes Date: Thu, 23 May 2024 11:13:12 -0700 Subject: [PATCH 1/4] Update docs-elastic-staging-publish.yml Done as part of our serverless move (https://github.com/elastic/docs-projects/issues/178) - Copies the public docs builder for a public repo (https://github.com/elastic/workflows/tree/main?tab=readme-ov-file#public-repos) - Updates paths to point at /docs/serverless --- .../docs-elastic-staging-publish.yml | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docs-elastic-staging-publish.yml b/.github/workflows/docs-elastic-staging-publish.yml index 6dfe8e7156..c0f79c61fd 100644 --- a/.github/workflows/docs-elastic-staging-publish.yml +++ b/.github/workflows/docs-elastic-staging-publish.yml @@ -1,25 +1,29 @@ -name: Staging Docs +name: Elastic docs on: pull_request_target: + # The paths property can be omitted entirely if the repo is mainly used for docs. Leaving it in can result in builds that + # have branch protection checks in place lose the ability to merge because the workflow is not starting. If this property + # is included, please ensure that branch protection checks are disabled for the repo. paths: - - '**.mdx' - - '**.docnav.json' - - '**.docapi.json' - - '**.devdocs.json' - - '**.jpg' - - '**.jpeg' - - '**.png' - - '**.svg' - - '**.gif' - types: [opened, closed, synchronize] + # Preface with your docs dir if you need further specificity (optional) + - 'docs/serverless/**.mdx' + - 'docs/serverless/**.docnav.json' + - 'docs/serverless/**.docapi.json' + - 'docs/serverless/**.devdocs.json' + - 'docs/serverless/**.jpg' + - 'docs/serverless/**.jpeg' + - 'docs/serverless/**.svg' + - 'docs/serverless/**.png' + - 'docs/serverless/**.gif' + types: [closed, opened, synchronize, labeled] jobs: publish: - name: Vercel Build Check + if: contains(github.event.pull_request.labels.*.name, 'ci:doc-build') uses: elastic/workflows/.github/workflows/docs-elastic-co-publish.yml@main secrets: - VERCEL_GITHUB_TOKEN: ${{ secrets.VERCEL_GITHUB_TOKEN }} - VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_GITHUB_TOKEN: ${{ secrets.VERCEL_GITHUB_TOKEN_PUBLIC }} + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_PUBLIC }} + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID_PUBLIC }} VERCEL_PROJECT_ID_DOCS_CO: ${{ secrets.VERCEL_PROJECT_ID_DOCS_CO }} From 00e4584f07b878709737c3c8659d824b8c6c859c Mon Sep 17 00:00:00 2001 From: glitteringkatie Date: Thu, 23 May 2024 11:57:19 -0700 Subject: [PATCH 2/4] Rename workflow --- .../{docs-elastic-staging-publish.yml => co-docs-builder.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{docs-elastic-staging-publish.yml => co-docs-builder.yml} (100%) diff --git a/.github/workflows/docs-elastic-staging-publish.yml b/.github/workflows/co-docs-builder.yml similarity index 100% rename from .github/workflows/docs-elastic-staging-publish.yml rename to .github/workflows/co-docs-builder.yml From 15e8a1d58e15914cd8e53f19ef369e5067d0df5a Mon Sep 17 00:00:00 2001 From: Katie Hughes Date: Thu, 23 May 2024 16:29:36 -0700 Subject: [PATCH 3/4] Update .github/workflows/co-docs-builder.yml --- .github/workflows/co-docs-builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/co-docs-builder.yml b/.github/workflows/co-docs-builder.yml index c0f79c61fd..f8103e5f8f 100644 --- a/.github/workflows/co-docs-builder.yml +++ b/.github/workflows/co-docs-builder.yml @@ -26,4 +26,4 @@ jobs: VERCEL_GITHUB_TOKEN: ${{ secrets.VERCEL_GITHUB_TOKEN_PUBLIC }} VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_PUBLIC }} VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID_PUBLIC }} - VERCEL_PROJECT_ID_DOCS_CO: ${{ secrets.VERCEL_PROJECT_ID_DOCS_CO }} + VERCEL_PROJECT_ID_DOCS_CO: ${{ secrets.VERCEL_PROJECT_ID_DOCS_CO_PUBLIC }} From b5e3786a1374f190ec23940a1363e4d2e74a8e38 Mon Sep 17 00:00:00 2001 From: glitteringkatie Date: Fri, 24 May 2024 09:26:58 -0700 Subject: [PATCH 4/4] Specifiy subdir & codeowners more --- .github/CODEOWNERS | 2 +- .github/workflows/co-docs-builder.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a747dbeb77..fdf053be76 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,2 @@ * @elastic/security-docs -/.github/workflows/ @elastic/docs-engineering +/.github/workflows/co-docs-builder.yml @elastic/docs-engineering diff --git a/.github/workflows/co-docs-builder.yml b/.github/workflows/co-docs-builder.yml index f8103e5f8f..e251dd00f4 100644 --- a/.github/workflows/co-docs-builder.yml +++ b/.github/workflows/co-docs-builder.yml @@ -22,6 +22,8 @@ jobs: publish: if: contains(github.event.pull_request.labels.*.name, 'ci:doc-build') uses: elastic/workflows/.github/workflows/docs-elastic-co-publish.yml@main + with: + subdirectory: 'docs/serverless/' secrets: VERCEL_GITHUB_TOKEN: ${{ secrets.VERCEL_GITHUB_TOKEN_PUBLIC }} VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_PUBLIC }}