From 1a183adebe806386b14945e90afcc45e610e1209 Mon Sep 17 00:00:00 2001 From: benjaminparisel Date: Wed, 12 Jun 2024 11:25:18 +0200 Subject: [PATCH] ci: Use reusable workflow Use the reusable workflow defined in bonita-documentation-site to configure and maintain them more easily. Covers bonitasoft/bonita-documentation-site#686 Covers bonitasoft/bonita-documentation-site#700 --- .github/workflows/pr-build-preview.yml | 16 ++++++++++++++++ .github/workflows/pr-comments-list-changes.yml | 16 ++++++++++++++++ .github/workflows/pr-deploy-preview.yml | 16 ++++++++++++++++ ...pr-preview.yml => pr-validate-references.yml} | 7 ++++--- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pr-build-preview.yml create mode 100644 .github/workflows/pr-comments-list-changes.yml create mode 100644 .github/workflows/pr-deploy-preview.yml rename .github/workflows/{build-pr-preview.yml => pr-validate-references.yml} (56%) diff --git a/.github/workflows/pr-build-preview.yml b/.github/workflows/pr-build-preview.yml new file mode 100644 index 0000000000..1070a4ca13 --- /dev/null +++ b/.github/workflows/pr-build-preview.yml @@ -0,0 +1,16 @@ +name: Build PR preview + +on: + pull_request: + paths: + - 'modules/**' + - 'antora.yml' + - '.github/workflows/pr-build-preview.yml' + +jobs: + build: + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_surge-build-preview.yml@master + secrets: inherit + with: + component-name: bonita + fail-on-warning: true diff --git a/.github/workflows/pr-comments-list-changes.yml b/.github/workflows/pr-comments-list-changes.yml new file mode 100644 index 0000000000..e3f3fc7ac0 --- /dev/null +++ b/.github/workflows/pr-comments-list-changes.yml @@ -0,0 +1,16 @@ +name: Comments PR with changes list + +on: + pull_request_target: + paths: + - '.github/workflows/pr-comments-list-changes.yml' + - 'modules/**' + +jobs: + site: + permissions: + pull-requests: write # write PR comments + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-comment-list-changes.yml@master + secrets: inherit + with: + component-name: bonita diff --git a/.github/workflows/pr-deploy-preview.yml b/.github/workflows/pr-deploy-preview.yml new file mode 100644 index 0000000000..e5e7ce2c61 --- /dev/null +++ b/.github/workflows/pr-deploy-preview.yml @@ -0,0 +1,16 @@ +name: Deploy PR preview + + +on: + workflow_run: + workflows: + - "Build PR preview" + types: + - completed + +jobs: + deploy: + permissions: + pull-requests: write + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_surge-deploy-preview.yml@master + secrets: inherit diff --git a/.github/workflows/build-pr-preview.yml b/.github/workflows/pr-validate-references.yml similarity index 56% rename from .github/workflows/build-pr-preview.yml rename to .github/workflows/pr-validate-references.yml index 1ba06af257..22dfa7be60 100644 --- a/.github/workflows/build-pr-preview.yml +++ b/.github/workflows/pr-validate-references.yml @@ -1,17 +1,18 @@ -name: Build PR preview +name: Vaidate xref on: pull_request: paths: - 'modules/**' - 'antora.yml' - - '.github/workflows/build-pr-preview.yml' + - '.github/workflows/pr-validate-references.yml' + jobs: validate_xref: runs-on: ubuntu-22.04 steps: - name: Validate xref - uses: bonitasoft/bonita-documentation-site/.github/actions/build-pr-site/@master + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-validate-references.yml/@master with: component-name: bonita fail-on-warning: true