From 10c66f496e911b105c7ce34818d10bd471059a14 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 14:39:26 +0200 Subject: [PATCH 01/14] first version Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 78 +++++++++++++++++++++++++++++ docs/mkdocs_requirements.txt | 9 ++++ 2 files changed, 87 insertions(+) create mode 100644 .github/workflows/deploy_mkdocs.yml create mode 100644 docs/mkdocs_requirements.txt diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml new file mode 100644 index 0000000000..9fd97c1e82 --- /dev/null +++ b/.github/workflows/deploy_mkdocs.yml @@ -0,0 +1,78 @@ +name: Deploy MkDocs + +on: + workflow_dispatch: + workflow_call: + inputs: + repo: + type: string + required: true + branch_name: + type: string + required: true + default: "main" + tag: + type: string + required: true + secrets: + token: + required: true + user: + required: true + email: + required: true + +env: + GH_TOKEN: ${{ secrets.token || secrets.YNPUT_BOT_TOKEN }} + GH_USER: ${{ secrets.user || secrets.CI_USER }} + GH_EMAIL: ${{ secrets.email || secrets.CI_EMAIL }} + +jobs: + + verify-latest-release: + uses: ynput/ops-repo-automation/.github/workflows/verify_latest_release.yml@main + with: + repo: ${{ github.repository }} + expect_release: true + secrets: + gh_token: ${{ secrets.token }} + + verify-repo-secrets: + uses: ynput/ops-repo-automation/.github/workflows/verify_secrets.yml@main + with: + repo: ${{ github.repository }} + secrets: + gh_token: ${{ secrets.token }} + gh_user: ${{ secrets.user }} + gh_email: ${{ secrets.email }} + + verify-repo-vars: + uses: ynput/ops-repo-automation/.github/workflows/verify_variables.yml@main + with: + variables: "MAIN_BRANCH,MINOR_BUMP_LABEL,PATCH_BUMP_LABEL,PROJECT_NAME" + repo: ${{ github.repository }} + secrets: + gh_token: ${{ secrets.token }} + + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout ${{ inputs.branch_name }} + uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch_name }} + fetch-depth: 0 + submodules: true + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python3 -m pip install -r ./docs/mkdocs_requirements.txt + + - name: Mike deploy + run: mike deploy --update-aliases ${{ inputs.tag }} latest diff --git a/docs/mkdocs_requirements.txt b/docs/mkdocs_requirements.txt new file mode 100644 index 0000000000..829d02951a --- /dev/null +++ b/docs/mkdocs_requirements.txt @@ -0,0 +1,9 @@ +mkdocs-material >= 9.6.7 +mkdocs-autoapi >= 0.4.0 +mkdocstrings-python >= 1.16.2 +mkdocs-minify-plugin >= 0.8.0 +markdown-checklist >= 0.4.4 +mdx-gh-links >= 0.4 +pymdown-extensions >= 10.14.3 +mike >= 2.1.3 +mkdocstrings-shell >= 1.0.2 From bd1dd87d242ee3d637133bea0e84ee64c2b76172 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 16:41:16 +0200 Subject: [PATCH 02/14] can I test this ? Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 9fd97c1e82..fcee1dd3c2 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -1,6 +1,7 @@ name: Deploy MkDocs on: + pull_request: workflow_dispatch: workflow_call: inputs: From 4977e771224ed202d76d11c6bfd6187d37812240 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 16:44:05 +0200 Subject: [PATCH 03/14] remove some tests Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index fcee1dd3c2..80e69b8fa1 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -30,13 +30,13 @@ env: jobs: - verify-latest-release: - uses: ynput/ops-repo-automation/.github/workflows/verify_latest_release.yml@main - with: - repo: ${{ github.repository }} - expect_release: true - secrets: - gh_token: ${{ secrets.token }} +# verify-latest-release: +# uses: ynput/ops-repo-automation/.github/workflows/verify_latest_release.yml@main +# with: +# repo: ${{ github.repository }} +# expect_release: true +# secrets: +# gh_token: ${{ secrets.token }} verify-repo-secrets: uses: ynput/ops-repo-automation/.github/workflows/verify_secrets.yml@main @@ -47,13 +47,13 @@ jobs: gh_user: ${{ secrets.user }} gh_email: ${{ secrets.email }} - verify-repo-vars: - uses: ynput/ops-repo-automation/.github/workflows/verify_variables.yml@main - with: - variables: "MAIN_BRANCH,MINOR_BUMP_LABEL,PATCH_BUMP_LABEL,PROJECT_NAME" - repo: ${{ github.repository }} - secrets: - gh_token: ${{ secrets.token }} +# verify-repo-vars: +# uses: ynput/ops-repo-automation/.github/workflows/verify_variables.yml@main +# with: +# variables: "MAIN_BRANCH,MINOR_BUMP_LABEL,PATCH_BUMP_LABEL,PROJECT_NAME" +# repo: ${{ github.repository }} +# secrets: +# gh_token: ${{ secrets.token }} deploy: runs-on: ubuntu-latest From dc9d65d9b85d6a4afe5eda2e3638facf2d7d2c6a Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 17:01:09 +0200 Subject: [PATCH 04/14] fix authentification error Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 80e69b8fa1..98866eb43e 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -66,6 +66,11 @@ jobs: fetch-depth: 0 submodules: true + - name: 🔑 Set Authentication + run: | + git config --global user.name "${{ secrets.user }}" + git config --global user.email "${{ secrets.email }}" + - name: Set up Python uses: actions/setup-python@v4 with: From 5899f484a5d242904b5ee21808b2c53249deadc7 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 17:10:26 +0200 Subject: [PATCH 05/14] better authentification fix Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 98866eb43e..8c05985613 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -68,8 +68,8 @@ jobs: - name: 🔑 Set Authentication run: | - git config --global user.name "${{ secrets.user }}" - git config --global user.email "${{ secrets.email }}" + git config --global user.name "${{ secrets.user || secrets.CI_USER }}" + git config --global user.email "${{ secrets.email || secrets.CI_EMAIL }}" - name: Set up Python uses: actions/setup-python@v4 From b5006abc8b51bf18f7ba4fa083925df364877692 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 17:15:09 +0200 Subject: [PATCH 06/14] display tag Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 8c05985613..49f6cfafba 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -80,5 +80,5 @@ jobs: run: | python3 -m pip install -r ./docs/mkdocs_requirements.txt - - name: Mike deploy + - name: Mike deploy ${{ inputs.tag }} run: mike deploy --update-aliases ${{ inputs.tag }} latest From 71a5a4603020905dbd2a33751b4f24030bbabadb Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 17:38:41 +0200 Subject: [PATCH 07/14] Get the current tag with fallback to 1.0.0 Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 30 ++++++++--------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 49f6cfafba..2e6329f924 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -12,9 +12,6 @@ on: type: string required: true default: "main" - tag: - type: string - required: true secrets: token: required: true @@ -29,15 +26,6 @@ env: GH_EMAIL: ${{ secrets.email || secrets.CI_EMAIL }} jobs: - -# verify-latest-release: -# uses: ynput/ops-repo-automation/.github/workflows/verify_latest_release.yml@main -# with: -# repo: ${{ github.repository }} -# expect_release: true -# secrets: -# gh_token: ${{ secrets.token }} - verify-repo-secrets: uses: ynput/ops-repo-automation/.github/workflows/verify_secrets.yml@main with: @@ -47,14 +35,6 @@ jobs: gh_user: ${{ secrets.user }} gh_email: ${{ secrets.email }} -# verify-repo-vars: -# uses: ynput/ops-repo-automation/.github/workflows/verify_variables.yml@main -# with: -# variables: "MAIN_BRANCH,MINOR_BUMP_LABEL,PATCH_BUMP_LABEL,PROJECT_NAME" -# repo: ${{ github.repository }} -# secrets: -# gh_token: ${{ secrets.token }} - deploy: runs-on: ubuntu-latest @@ -71,6 +51,12 @@ jobs: git config --global user.name "${{ secrets.user || secrets.CI_USER }}" git config --global user.email "${{ secrets.email || secrets.CI_EMAIL }}" + - name: Get current tag + id: git_tag + uses: "devops-actions/action-get-tag@v1.0.3" + with: + default: 1.0.0 + - name: Set up Python uses: actions/setup-python@v4 with: @@ -80,5 +66,5 @@ jobs: run: | python3 -m pip install -r ./docs/mkdocs_requirements.txt - - name: Mike deploy ${{ inputs.tag }} - run: mike deploy --update-aliases ${{ inputs.tag }} latest + - name: Mike deploy ${{ steps.git_tag.outputs.tag }} + run: mike deploy --update-aliases ${{ steps.git_tag.outputs.tag }} latest From 17fbd5228cad7a867137751f2a0ceb125f10f0a0 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 17:43:42 +0200 Subject: [PATCH 08/14] remove quotes Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 2e6329f924..a8281a1de0 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -53,7 +53,7 @@ jobs: - name: Get current tag id: git_tag - uses: "devops-actions/action-get-tag@v1.0.3" + uses: devops-actions/action-get-tag@v1.0.3 with: default: 1.0.0 From 18c0299bfb9a1812a485d8c454f68f5d165f5271 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 17:47:57 +0200 Subject: [PATCH 09/14] fix missing branch name Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index a8281a1de0..4d6fd9104e 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -39,10 +39,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout ${{ inputs.branch_name }} + - name: Checkout ${{ inputs.branch_name || 'main' }} uses: actions/checkout@v4 with: - ref: ${{ inputs.branch_name }} + ref: ${{ inputs.branch_name || 'main' }} fetch-depth: 0 submodules: true From af9fd17ee8108f4a13b9777fa9daf68e3a09fa74 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Fri, 9 May 2025 17:55:49 +0200 Subject: [PATCH 10/14] format Signed-off-by: Philippe Leprince --- .github/workflows/deploy_mkdocs.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 4d6fd9104e..2f46bdc6ad 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -21,28 +21,28 @@ on: required: true env: - GH_TOKEN: ${{ secrets.token || secrets.YNPUT_BOT_TOKEN }} - GH_USER: ${{ secrets.user || secrets.CI_USER }} - GH_EMAIL: ${{ secrets.email || secrets.CI_EMAIL }} + GH_TOKEN: ${{ secrets.token || secrets.YNPUT_BOT_TOKEN }} + GH_USER: ${{ secrets.user || secrets.CI_USER }} + GH_EMAIL: ${{ secrets.email || secrets.CI_EMAIL }} jobs: verify-repo-secrets: - uses: ynput/ops-repo-automation/.github/workflows/verify_secrets.yml@main - with: - repo: ${{ github.repository }} - secrets: - gh_token: ${{ secrets.token }} - gh_user: ${{ secrets.user }} - gh_email: ${{ secrets.email }} + uses: ynput/ops-repo-automation/.github/workflows/verify_secrets.yml@main + with: + repo: ${{ github.repository }} + secrets: + gh_token: ${{ secrets.token }} + gh_user: ${{ secrets.user }} + gh_email: ${{ secrets.email }} deploy: runs-on: ubuntu-latest steps: - - name: Checkout ${{ inputs.branch_name || 'main' }} + - name: Checkout ${{ inputs.branch_name}} uses: actions/checkout@v4 with: - ref: ${{ inputs.branch_name || 'main' }} + ref: ${{ inputs.branch_name}} fetch-depth: 0 submodules: true From 216c06437fe2ea50d58a56f5d917f6d962818f28 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 15 Sep 2025 19:20:10 +0300 Subject: [PATCH 11/14] MK Docs: Update light/dark modes icons --- mkdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 8e4c2663bc..a3b89b5455 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,12 +11,12 @@ theme: - media: "(prefers-color-scheme: dark)" scheme: slate toggle: - icon: material/toggle-switch-off-outline + icon: material/weather-sunny name: Switch to light mode - media: "(prefers-color-scheme: light)" scheme: default toggle: - icon: material/toggle-switch + icon: material/weather-night name: Switch to dark mode logo: img/ay-symbol-blackw-full.png favicon: img/favicon.ico From 99c50c3a14a96a5b227a1f27c17191ce8ade0d73 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 16 Sep 2025 11:54:01 +0300 Subject: [PATCH 12/14] move mkdocs_requirements to root location. --- docs/mkdocs_requirements.txt => mkdocs_requirements.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/mkdocs_requirements.txt => mkdocs_requirements.txt (100%) diff --git a/docs/mkdocs_requirements.txt b/mkdocs_requirements.txt similarity index 100% rename from docs/mkdocs_requirements.txt rename to mkdocs_requirements.txt From eaa6727a9d0ae5289961b5b46d9fdf9245e6c93a Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 16 Sep 2025 11:56:00 +0300 Subject: [PATCH 13/14] CI: Re-use `deploy_mkdocs` from ynput/ops-repo-automation --- .github/workflows/deploy_mkdocs.yml | 69 ++++------------------------- 1 file changed, 8 insertions(+), 61 deletions(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 2f46bdc6ad..1e02643a3d 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -1,70 +1,17 @@ name: Deploy MkDocs on: - pull_request: + push: + tags: + - "*" workflow_dispatch: - workflow_call: - inputs: - repo: - type: string - required: true - branch_name: - type: string - required: true - default: "main" - secrets: - token: - required: true - user: - required: true - email: - required: true - -env: - GH_TOKEN: ${{ secrets.token || secrets.YNPUT_BOT_TOKEN }} - GH_USER: ${{ secrets.user || secrets.CI_USER }} - GH_EMAIL: ${{ secrets.email || secrets.CI_EMAIL }} jobs: - verify-repo-secrets: - uses: ynput/ops-repo-automation/.github/workflows/verify_secrets.yml@main + build-mk-docs: + uses: ynput/ops-repo-automation/.github/workflows/deploy_mkdocs.yml@feature/34-add-mk-docs-reusable-workflow with: repo: ${{ github.repository }} secrets: - gh_token: ${{ secrets.token }} - gh_user: ${{ secrets.user }} - gh_email: ${{ secrets.email }} - - deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout ${{ inputs.branch_name}} - uses: actions/checkout@v4 - with: - ref: ${{ inputs.branch_name}} - fetch-depth: 0 - submodules: true - - - name: 🔑 Set Authentication - run: | - git config --global user.name "${{ secrets.user || secrets.CI_USER }}" - git config --global user.email "${{ secrets.email || secrets.CI_EMAIL }}" - - - name: Get current tag - id: git_tag - uses: devops-actions/action-get-tag@v1.0.3 - with: - default: 1.0.0 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - - name: Install dependencies - run: | - python3 -m pip install -r ./docs/mkdocs_requirements.txt - - - name: Mike deploy ${{ steps.git_tag.outputs.tag }} - run: mike deploy --update-aliases ${{ steps.git_tag.outputs.tag }} latest + YNPUT_BOT_TOKEN: ${{ secrets.YNPUT_BOT_TOKEN }} + CI_USER: ${{ secrets.CI_USER }} + CI_EMAIL: ${{ secrets.CI_EMAIL }} From a46a9e3143998c93d04824d3aa795e8f53b580d8 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 16 Sep 2025 13:04:54 +0300 Subject: [PATCH 14/14] CI: Update Deploy MkDocs to use action from develop branch from ynput/ops-repo-automation --- .github/workflows/deploy_mkdocs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_mkdocs.yml b/.github/workflows/deploy_mkdocs.yml index 1e02643a3d..deafc7b850 100644 --- a/.github/workflows/deploy_mkdocs.yml +++ b/.github/workflows/deploy_mkdocs.yml @@ -8,7 +8,8 @@ on: jobs: build-mk-docs: - uses: ynput/ops-repo-automation/.github/workflows/deploy_mkdocs.yml@feature/34-add-mk-docs-reusable-workflow + # FIXME: Update @develop to @main after `ops-repo-automation` release. + uses: ynput/ops-repo-automation/.github/workflows/deploy_mkdocs.yml@develop with: repo: ${{ github.repository }} secrets: