From 78cd2397964e5c2af10a11bf518f3e6be9f665b9 Mon Sep 17 00:00:00 2001 From: Karl Johan Grahn Date: Thu, 1 Aug 2024 17:30:14 +0200 Subject: [PATCH 1/3] update --- .github/workflows/branch_deleted.yaml | 12 ++-- .github/workflows/mkdocs_branch_deleted.yaml | 61 ------------------- .../workflows/mkdocs_pull_request_closed.yaml | 43 ------------- .../mkdocs_pull_request_versioned_doc.yaml | 43 ------------- .../workflows/mkdocs_push_versioned_doc.yaml | 54 ---------------- .github/workflows/pull_request_closed.yaml | 11 +++- .../workflows/pull_request_versioned_doc.yaml | 11 +++- .github/workflows/push_versioned_doc.yaml | 13 ++-- 8 files changed, 33 insertions(+), 215 deletions(-) delete mode 100644 .github/workflows/mkdocs_branch_deleted.yaml delete mode 100644 .github/workflows/mkdocs_pull_request_closed.yaml delete mode 100644 .github/workflows/mkdocs_pull_request_versioned_doc.yaml delete mode 100644 .github/workflows/mkdocs_push_versioned_doc.yaml diff --git a/.github/workflows/branch_deleted.yaml b/.github/workflows/branch_deleted.yaml index d137c9a..7405d9c 100644 --- a/.github/workflows/branch_deleted.yaml +++ b/.github/workflows/branch_deleted.yaml @@ -1,4 +1,4 @@ -name: Deleting a branch for versioned doc +name: Deleting a branch for versioned mkdocs on: workflow_call: @@ -34,9 +34,13 @@ jobs: with: python-version: 3.11 - - name: Install doc tools - if: steps.branch_check.outputs.matched == 'true' - run: pip3 install mkdocs-material mkdocs-mermaid2-plugin mike mkdocs-glightbox + - name: Install mike + run: pip3 install mike + + - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders + run: | + chmod +x prepare_theme.sh + ./prepare_theme.sh - name: Configure Git user if: steps.branch_check.outputs.matched == 'true' diff --git a/.github/workflows/mkdocs_branch_deleted.yaml b/.github/workflows/mkdocs_branch_deleted.yaml deleted file mode 100644 index 7405d9c..0000000 --- a/.github/workflows/mkdocs_branch_deleted.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: Deleting a branch for versioned mkdocs - -on: - workflow_call: - secrets: - GH_TOKEN: - description: "GitHub token" - required: true - -jobs: - delete: - if: github.event.ref_type == 'branch' - runs-on: ubuntu-latest - steps: - - name: Check if the deleted branch is a version branch - id: branch_check - uses: MeilCli/regex-match@v1 - with: - regex_pattern: '^[0-9]+\.[0-9]+(\.[0-9]+)?$' - search_string: ${{ github.event.ref }} - - - name: Checkout source files - if: steps.branch_check.outputs.matched == 'true' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - persist-credentials: true - token: ${{ secrets.GH_TOKEN }} - - - name: Set up Python - if: steps.branch_check.outputs.matched == 'true' - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - - name: Install mike - run: pip3 install mike - - - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders - run: | - chmod +x prepare_theme.sh - ./prepare_theme.sh - - - name: Configure Git user - if: steps.branch_check.outputs.matched == 'true' - run: | - git config --local user.email "stakater@gmail.com" - git config --local user.name "stakater-user" - - - name: Delete removed version - if: steps.branch_check.outputs.matched == 'true' - run: mike delete --push ${{ github.event.ref }} - - - name: Push Latest Tag - if: steps.branch_check.outputs.matched == 'true' - uses: anothrNick/github-tag-action@1.61.0 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - WITH_V: true - DEFAULT_BUMP: patch diff --git a/.github/workflows/mkdocs_pull_request_closed.yaml b/.github/workflows/mkdocs_pull_request_closed.yaml deleted file mode 100644 index 9ca805f..0000000 --- a/.github/workflows/mkdocs_pull_request_closed.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Closing a pull request for versioned mkdocs - -on: - workflow_call: - secrets: - GH_TOKEN: - description: "GitHub token" - required: true - -jobs: - push: - runs-on: ubuntu-latest - steps: - - name: Checkout source files - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - persist-credentials: true - token: ${{ secrets.GH_TOKEN }} - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - - name: Install mike - run: pip3 install mike - - - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders - run: | - chmod +x prepare_theme.sh - ./prepare_theme.sh - - - name: Configure Git user - run: | - git config --local user.email "stakater@gmail.com" - git config --local user.name "stakater-user" - - - name: Delete redundant PR deployment - env: - HEAD_REF: ${{ github.head_ref }} - run: mike delete --push -b pull-request-deployments ${HEAD_REF//\//-} diff --git a/.github/workflows/mkdocs_pull_request_versioned_doc.yaml b/.github/workflows/mkdocs_pull_request_versioned_doc.yaml deleted file mode 100644 index 14aed39..0000000 --- a/.github/workflows/mkdocs_pull_request_versioned_doc.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Pull request for versioned mkdocs - -on: - workflow_call: - secrets: - GH_TOKEN: - description: "GitHub token" - required: true - -jobs: - deploy_doc: - runs-on: ubuntu-latest - steps: - - name: Checkout source files - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - persist-credentials: true - token: ${{ secrets.GH_TOKEN }} - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - - name: Install plugins - run: pip3 install mike mkdocs-mermaid2-plugin - - - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders - run: | - chmod +x prepare_theme.sh - ./prepare_theme.sh - - - name: Configure git user - run: | - git config --local user.email "stakater@gmail.com" - git config --local user.name "stakater-user" - - - name: Deploy PR docs - env: - HEAD_REF: ${{ github.head_ref }} - run: mike deploy --push -b pull-request-deployments ${HEAD_REF//\//-} diff --git a/.github/workflows/mkdocs_push_versioned_doc.yaml b/.github/workflows/mkdocs_push_versioned_doc.yaml deleted file mode 100644 index d28137a..0000000 --- a/.github/workflows/mkdocs_push_versioned_doc.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Push versioned mkdocs - -on: - workflow_call: - secrets: - GH_TOKEN: - description: "GitHub token" - required: true - -jobs: - push: - runs-on: ubuntu-latest - steps: - - name: Checkout source files - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - persist-credentials: true - token: ${{ secrets.GH_TOKEN }} - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - - name: Install mike - run: pip3 install mike mkdocs-mermaid2-plugin - - - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders - run: | - chmod +x prepare_theme.sh - ./prepare_theme.sh - - - name: Configure Git user - run: | - git config --local user.email "stakater@gmail.com" - git config --local user.name "stakater-user" - - - name: Deploy content - run: mike deploy --push ${{ github.ref_name }} - - - name: Set alias - run: mike alias --push main latest - - - name: Set default doc version - run: mike set-default --push latest - - - name: Push Latest Tag - uses: anothrNick/github-tag-action@1.61.0 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - WITH_V: true - DEFAULT_BUMP: patch diff --git a/.github/workflows/pull_request_closed.yaml b/.github/workflows/pull_request_closed.yaml index 55d57cf..9ca805f 100644 --- a/.github/workflows/pull_request_closed.yaml +++ b/.github/workflows/pull_request_closed.yaml @@ -1,4 +1,4 @@ -name: Closing a pull request for versioned doc +name: Closing a pull request for versioned mkdocs on: workflow_call: @@ -24,8 +24,13 @@ jobs: with: python-version: 3.11 - - name: Install doc tools - run: pip3 install mkdocs-material mkdocs-mermaid2-plugin mike mkdocs-glightbox + - name: Install mike + run: pip3 install mike + + - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders + run: | + chmod +x prepare_theme.sh + ./prepare_theme.sh - name: Configure Git user run: | diff --git a/.github/workflows/pull_request_versioned_doc.yaml b/.github/workflows/pull_request_versioned_doc.yaml index cc40be0..14aed39 100644 --- a/.github/workflows/pull_request_versioned_doc.yaml +++ b/.github/workflows/pull_request_versioned_doc.yaml @@ -1,4 +1,4 @@ -name: Pull request for versioned doc +name: Pull request for versioned mkdocs on: workflow_call: @@ -24,8 +24,13 @@ jobs: with: python-version: 3.11 - - name: Install doc tools - run: pip3 install mkdocs-material mkdocs-mermaid2-plugin mike mkdocs-glightbox + - name: Install plugins + run: pip3 install mike mkdocs-mermaid2-plugin + + - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders + run: | + chmod +x prepare_theme.sh + ./prepare_theme.sh - name: Configure git user run: | diff --git a/.github/workflows/push_versioned_doc.yaml b/.github/workflows/push_versioned_doc.yaml index f10a107..d28137a 100644 --- a/.github/workflows/push_versioned_doc.yaml +++ b/.github/workflows/push_versioned_doc.yaml @@ -1,4 +1,4 @@ -name: Push versioned doc +name: Push versioned mkdocs on: workflow_call: @@ -24,14 +24,19 @@ jobs: with: python-version: 3.11 - - name: Install doc tools - run: pip3 install mkdocs-material mkdocs-mermaid2-plugin mike mkdocs-glightbox + - name: Install mike + run: pip3 install mike mkdocs-mermaid2-plugin + + - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders + run: | + chmod +x prepare_theme.sh + ./prepare_theme.sh - name: Configure Git user run: | git config --local user.email "stakater@gmail.com" git config --local user.name "stakater-user" - + - name: Deploy content run: mike deploy --push ${{ github.ref_name }} From 866e0275c21619b733e8361aed0bd7bf96739871 Mon Sep 17 00:00:00 2001 From: Karl Johan Grahn Date: Thu, 1 Aug 2024 18:33:31 +0200 Subject: [PATCH 2/3] update --- .github/workflows/branch_deleted.yaml | 4 +++- .github/workflows/pull_request_closed.yaml | 2 +- .github/workflows/pull_request_versioned_doc.yaml | 2 +- .github/workflows/push_versioned_doc.yaml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/branch_deleted.yaml b/.github/workflows/branch_deleted.yaml index 7405d9c..0decfc5 100644 --- a/.github/workflows/branch_deleted.yaml +++ b/.github/workflows/branch_deleted.yaml @@ -1,4 +1,4 @@ -name: Deleting a branch for versioned mkdocs +name: Deleting a branch for versioned doc on: workflow_call: @@ -35,9 +35,11 @@ jobs: python-version: 3.11 - name: Install mike + if: steps.branch_check.outputs.matched == 'true' run: pip3 install mike - name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders + if: steps.branch_check.outputs.matched == 'true' run: | chmod +x prepare_theme.sh ./prepare_theme.sh diff --git a/.github/workflows/pull_request_closed.yaml b/.github/workflows/pull_request_closed.yaml index 9ca805f..6259820 100644 --- a/.github/workflows/pull_request_closed.yaml +++ b/.github/workflows/pull_request_closed.yaml @@ -1,4 +1,4 @@ -name: Closing a pull request for versioned mkdocs +name: Closing a pull request for versioned doc on: workflow_call: diff --git a/.github/workflows/pull_request_versioned_doc.yaml b/.github/workflows/pull_request_versioned_doc.yaml index 14aed39..b418ee7 100644 --- a/.github/workflows/pull_request_versioned_doc.yaml +++ b/.github/workflows/pull_request_versioned_doc.yaml @@ -1,4 +1,4 @@ -name: Pull request for versioned mkdocs +name: Pull request for versioned doc on: workflow_call: diff --git a/.github/workflows/push_versioned_doc.yaml b/.github/workflows/push_versioned_doc.yaml index d28137a..65603d9 100644 --- a/.github/workflows/push_versioned_doc.yaml +++ b/.github/workflows/push_versioned_doc.yaml @@ -1,4 +1,4 @@ -name: Push versioned mkdocs +name: Push versioned doc on: workflow_call: From 3b53baf57c30e484f653de1bf98befaf84ae0229 Mon Sep 17 00:00:00 2001 From: Karl Johan Grahn Date: Thu, 1 Aug 2024 18:34:16 +0200 Subject: [PATCH 3/3] update --- .github/workflows/push_versioned_doc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_versioned_doc.yaml b/.github/workflows/push_versioned_doc.yaml index 65603d9..1d8104f 100644 --- a/.github/workflows/push_versioned_doc.yaml +++ b/.github/workflows/push_versioned_doc.yaml @@ -36,7 +36,7 @@ jobs: run: | git config --local user.email "stakater@gmail.com" git config --local user.name "stakater-user" - + - name: Deploy content run: mike deploy --push ${{ github.ref_name }}