From a5e82fe408931a7dfbc36c5ac2c5c3f7f2209d78 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Wed, 27 Aug 2025 16:37:45 +0200 Subject: [PATCH] update cd.yml to be better??? test run --- .github/workflows/cd.yml | 122 ++++++++++++++++++++++++++++++++++----- 1 file changed, 106 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c77e2e1..ebc3c81 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,42 +29,132 @@ jobs: - name: Configure Pages uses: actions/configure-pages@v5 - - name: Aggregate files from all branches into ./public + - name: Aggregate and build recursive directory pages shell: bash run: | set -euo pipefail + + OWNER="${GITHUB_REPOSITORY%/*}" + REPO="${GITHUB_REPOSITORY#*/}" + SITE_ROOT="/${REPO}/" + mkdir -p public + : > public/.nojekyll - # List remote branches (exclude HEAD pointer) - mapfile -t BRANCHES < <(git ls-remote --heads origin \ - | awk '{print $2}' | sed 's@refs/heads/@@') + # List remote branches + mapfile -t BRANCHES < <( + git ls-remote --heads origin | awk '{print $2}' \ + | sed 's@refs/heads/@@' + ) - # Minimal index page + # Top-level landing page cat > public/index.html <<'HTML' - - Branches

Branches

" >> public/index.html - echo "Built public/ for ${#BRANCHES[@]} branches." + + # Finish landing page with JS to render branch cards + cat >> public/index.html <<'HTML' + + HTML - name: Upload Pages artifact uses: actions/upload-pages-artifact@v4 @@ -73,4 +163,4 @@ jobs: - name: Deploy to GitHub Pages id: deploy - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v4 \ No newline at end of file