From d31e83841731d5e6546eccf7a25bc541ed2b15d3 Mon Sep 17 00:00:00 2001 From: Lukas Wagner Date: Sun, 10 May 2026 23:27:18 +0200 Subject: [PATCH] Fix docs deployment to generate versions.json before first release - Remove release-only condition on versions.json/redirect step so it runs on every deploy (including main-branch) - Default redirect to /main-branch/ when no releases exist yet - Guard version selector against rendering an empty dropdown - Update actions/github-script to v9 - Add docs badge to README --- .github/scripts/generate-redirect.sh | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/deploy-docs.yml | 1 - .github/workflows/release.yml | 2 +- README.md | 1 + docs/src/version-selector.js | 2 ++ 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/generate-redirect.sh b/.github/scripts/generate-redirect.sh index d193a63..4b4d6c0 100755 --- a/.github/scripts/generate-redirect.sh +++ b/.github/scripts/generate-redirect.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -LATEST="${1}" +LATEST="${1:-main-branch}" OUTPUT="${2:-index.html}" cat > "$OUTPUT" << HTMLEOF diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa9e82c..546a668 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,7 @@ jobs: actions: write steps: - name: Trigger docs deployment - uses: actions/github-script@v7 + uses: actions/github-script@v9 with: script: | await github.rest.actions.createWorkflowDispatch({ diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 1babb1a..7334f37 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -75,7 +75,6 @@ jobs: keep_files: true - name: Update versions.json and root redirect - if: steps.target.outputs.is_release == 'true' env: GH_TOKEN: ${{ steps.app-token.outputs.token }} run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2568404..b34b7da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,7 +129,7 @@ jobs: echo "Detected version: $VERSION" - name: Trigger docs deployment - uses: actions/github-script@v7 + uses: actions/github-script@v9 with: script: | await github.rest.actions.createWorkflowDispatch({ diff --git a/README.md b/README.md index 258dd8c..7af457d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![CI](https://github.com/lukidoescode/lldap-operator/actions/workflows/ci.yml/badge.svg)](https://github.com/lukidoescode/lldap-operator/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) +[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://lukidoescode.github.io/lldap-operator/) A Kubernetes operator that manages [lldap](https://github.com/lldap/lldap) users and groups as native Kubernetes resources via Custom Resource Definitions diff --git a/docs/src/version-selector.js b/docs/src/version-selector.js index 0306289..acad34c 100644 --- a/docs/src/version-selector.js +++ b/docs/src/version-selector.js @@ -31,6 +31,8 @@ select.appendChild(opt); }); + if (select.options.length === 0) return; + select.addEventListener('change', function () { window.location.href = '/' + this.value + '/' + currentPage; });