From 1cf15a1c183ad1908045277ebb8d962acb2bd558 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Tue, 28 Jan 2025 13:34:46 +0100 Subject: [PATCH 1/6] Add preview env --- .github/workflows/docs-preview.yml | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 8a197b9ad9..ac089956e9 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -1,23 +1,20 @@ -name: docs-preview +name: PR + on: - pull_request_target: - types: [opened] - paths: - - '**.asciidoc' - - '**.jpg' - - '**.png' - - '**.gif' + pull_request: permissions: - pull-requests: write + contents: read + id-token: write + deployments: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - doc-preview-pr: + docs: runs-on: ubuntu-latest steps: - - uses: elastic/docs/.github/actions/docs-preview@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - repo: ${{ github.event.repository.name }} - preview-path: 'guide/index.html' - pr: ${{ github.event.pull_request.number }} + - uses: actions/checkout@v4 + - uses: elastic/docs-builder/actions/preview@feature/consumer-preview-action From 8c711211165f01b7e57d4344c35cb6ae07056be7 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Tue, 28 Jan 2025 13:54:27 +0100 Subject: [PATCH 2/6] Update docs-preview.yml --- .github/workflows/docs-preview.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index ac089956e9..25fbf04af1 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -17,4 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: elastic/docs-builder@main + with: + strict: false - uses: elastic/docs-builder/actions/preview@feature/consumer-preview-action + with: + strict: false From 882f77406b4dbf30850c5f49d198b448e175b2bb Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Tue, 28 Jan 2025 18:44:38 +0100 Subject: [PATCH 3/6] Update docs-preview.yml --- .github/workflows/docs-preview.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 25fbf04af1..a2f1db84c3 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -17,9 +17,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: elastic/docs-builder@main - with: - strict: false - uses: elastic/docs-builder/actions/preview@feature/consumer-preview-action with: strict: false From f810e030a5dbbfceb983d04f780d15cc97f00983 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Wed, 29 Jan 2025 00:28:36 +0100 Subject: [PATCH 4/6] Use reusable workflows --- .github/workflows/docs-preview.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/docs-preview.yml diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml deleted file mode 100644 index a2f1db84c3..0000000000 --- a/.github/workflows/docs-preview.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: PR - -on: - pull_request: - -permissions: - contents: read - id-token: write - deployments: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: elastic/docs-builder/actions/preview@feature/consumer-preview-action - with: - strict: false From c3801fc7550f6b3b0e4234bdccfdbba44ec28fb6 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Wed, 29 Jan 2025 00:29:57 +0100 Subject: [PATCH 5/6] Use reusable workflows --- .github/workflows/docs-cleanup.yml | 14 ++++++++++++++ .github/workflows/docs.yml | 25 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/docs-cleanup.yml create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs-cleanup.yml b/.github/workflows/docs-cleanup.yml new file mode 100644 index 0000000000..c813e43901 --- /dev/null +++ b/.github/workflows/docs-cleanup.yml @@ -0,0 +1,14 @@ +name: docs + +on: + pull_request_target: + types: + - closed + +jobs: + docs-preview: + uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@feature/consumer-preview-action + permissions: + contents: read + id-token: write + deployments: write diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..ef9b40c6f6 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,25 @@ +name: docs + +on: + pull_request: + types: + - synchronize + - opened + - reopened + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + docs-preview: + uses: elastic/docs-builder/.github/workflows/preview.yml@feature/consumer-preview-action + permissions: + contents: read + id-token: write + deployments: write + with: + strict: false From 1a6e6fd9e3f60d4ce1b40ff92431fbcda58b8ec7 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Wed, 29 Jan 2025 10:55:20 +0100 Subject: [PATCH 6/6] Change version qualifier to main --- .github/workflows/docs-cleanup.yml | 2 +- .github/workflows/docs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs-cleanup.yml b/.github/workflows/docs-cleanup.yml index c813e43901..de3ff6b528 100644 --- a/.github/workflows/docs-cleanup.yml +++ b/.github/workflows/docs-cleanup.yml @@ -7,7 +7,7 @@ on: jobs: docs-preview: - uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@feature/consumer-preview-action + uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main permissions: contents: read id-token: write diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ef9b40c6f6..06fa52866b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ concurrency: jobs: docs-preview: - uses: elastic/docs-builder/.github/workflows/preview.yml@feature/consumer-preview-action + uses: elastic/docs-builder/.github/workflows/preview.yml@main permissions: contents: read id-token: write