From c1daf31f035dbf8a51c12954d5d66ccb6fc6fe7e Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:34:44 +0200 Subject: [PATCH] ci: use reusable workflows (#60) Use the reusable workflow defined in bonita-documentation-site to configure and maintain them more easily. Covers https://github.com/bonitasoft/bonita-documentation-site/issues/686 Covers https://github.com/bonitasoft/bonita-documentation-site/issues/700 --- .github/workflows/build-pr-preview.yml | 17 -------------- .github/workflows/pr-build-preview.yml | 15 +++++++++++++ .../workflows/pr-comments-changes-list.yml | 17 ++++++++++++++ .github/workflows/pr-deploy-preview.yml | 16 ++++++++++++++ .github/workflows/pr-validate-references.yml | 16 ++++++++++++++ .github/workflows/publish-pr-preview.yml | 22 ------------------- 6 files changed, 64 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/build-pr-preview.yml create mode 100644 .github/workflows/pr-build-preview.yml create mode 100644 .github/workflows/pr-comments-changes-list.yml create mode 100644 .github/workflows/pr-deploy-preview.yml create mode 100644 .github/workflows/pr-validate-references.yml delete mode 100644 .github/workflows/publish-pr-preview.yml diff --git a/.github/workflows/build-pr-preview.yml b/.github/workflows/build-pr-preview.yml deleted file mode 100644 index 7e3c1f7..0000000 --- a/.github/workflows/build-pr-preview.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Build PR preview - -on: - pull_request: - paths: - - 'modules/**' - - 'antora.yml' - - '.github/workflows/build-pr-preview.yml' -jobs: - validate_xref: - runs-on: ubuntu-22.04 - steps: - - name: Validate xref - uses: bonitasoft/bonita-documentation-site/.github/actions/build-pr-site/@master - with: - component-name: cloud - fail-on-warning: true diff --git a/.github/workflows/pr-build-preview.yml b/.github/workflows/pr-build-preview.yml new file mode 100644 index 0000000..63c2b9d --- /dev/null +++ b/.github/workflows/pr-build-preview.yml @@ -0,0 +1,15 @@ +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: cloud diff --git a/.github/workflows/pr-comments-changes-list.yml b/.github/workflows/pr-comments-changes-list.yml new file mode 100644 index 0000000..a2815fb --- /dev/null +++ b/.github/workflows/pr-comments-changes-list.yml @@ -0,0 +1,17 @@ +name: Comments PR with changes list + +on: + # use pull_request event to test update done in bonita-documentation-site/.github/workflows/_reusable_pr-comment-list-changes.yml + pull_request_target: + paths: + - '.github/workflows/pr-comments-changes-list.yml' + - 'modules/**' + +jobs: + commentsPRChanges: + 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: cloud diff --git a/.github/workflows/pr-deploy-preview.yml b/.github/workflows/pr-deploy-preview.yml new file mode 100644 index 0000000..e5e7ce2 --- /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/pr-validate-references.yml b/.github/workflows/pr-validate-references.yml new file mode 100644 index 0000000..7e2bde2 --- /dev/null +++ b/.github/workflows/pr-validate-references.yml @@ -0,0 +1,16 @@ +name: Validate xref + +on: + pull_request: + paths: + - 'modules/**' + - 'antora.yml' + - '.github/workflows/pr-validate-references.yml' + +jobs: + validate_xref: + uses: bonitasoft/bonita-documentation-site/.github/workflows/_reusable_pr-validate-references.yml@master + secrets: inherit + with: + component-name: cloud + fail-on-warning: true diff --git a/.github/workflows/publish-pr-preview.yml b/.github/workflows/publish-pr-preview.yml deleted file mode 100644 index 2e3ace7..0000000 --- a/.github/workflows/publish-pr-preview.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish PR preview - -on: - pull_request: - # To manage 'surge-preview' action teardown, add default event types + closed event type - types: [opened, synchronize, reopened, closed] - paths: - - 'modules/ROOT/**' - - 'antora.yml' - - '.github/workflows/publish-pr-preview.yml' -jobs: - build_preview: - runs-on: ubuntu-22.04 - permissions: - pull-requests: write # surge-preview write PR comments - steps: - - name: Build and publish pr preview - uses: bonitasoft/bonita-documentation-site/.github/actions/build-and-publish-pr-preview/@master - with: - surge-token: ${{ secrets.SURGE_TOKEN_DOC }} - github-token: ${{ secrets.GITHUB_TOKEN }} - component-name: cloud \ No newline at end of file