this repo has no description

comeon kimi k2.5!

+55 -51
+55 -51
.github/workflows/deploy-sites.yaml
··· 34 34 sites+=("${dir%/}") 35 35 fi 36 36 done 37 - 38 - # Create JSON array for matrix strategy 39 - sites_json=$(printf '%s\n' "${sites[@]}" | jq -R . | jq -s .) 37 + 38 + # Create JSON array and output on single line 39 + sites_json=$(printf '%s\n' "${sites[@]}" | jq -R . | jq -s -c .) 40 40 echo "sites=$sites_json" >> $GITHUB_OUTPUT 41 41 echo "Found sites: $sites_json" 42 42 ··· 54 54 run: | 55 55 mkdir -p _site/${{ matrix.site }} 56 56 cp -r ${{ matrix.site }}/* _site/${{ matrix.site }}/ 57 - 58 - # Create a root index if it doesn't exist 59 - if [ ! -f "_site/index.html" ]; then 60 - cat > _site/index.html << 'EOF' 61 - <!DOCTYPE html> 62 - <html> 63 - <head> 64 - <title>Sites Index</title> 65 - <style> 66 - body { font-family: system-ui, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; } 67 - h1 { color: #333; } 68 - ul { list-style: none; padding: 0; } 69 - li { margin: 10px 0; } 70 - a { color: #0366d6; text-decoration: none; font-size: 1.1em; } 71 - a:hover { text-decoration: underline; } 72 - </style> 73 - </head> 74 - <body> 75 - <h1>📁 Available Sites</h1> 76 - <ul id="sites-list"></ul> 77 - <script> 78 - const sites = document.getElementById('sites-list'); 79 - const paths = window.location.pathname.split('/').filter(p => p); 80 - const basePath = paths.length > 0 ? '/' + paths.join('/') : ''; 81 - 82 - fetch(basePath + '/sites.json') 83 - .then(r => r.json()) 84 - .then(data => { 85 - data.forEach(site => { 86 - const li = document.createElement('li'); 87 - const a = document.createElement('a'); 88 - a.href = './' + site + '/'; 89 - a.textContent = site; 90 - li.appendChild(a); 91 - sites.appendChild(li); 92 - }); 93 - }); 94 - </script> 95 - </body> 96 - </html> 97 - EOF 98 - fi 99 57 100 58 - name: Upload site artifact 101 59 uses: actions/upload-artifact@v4 ··· 103 61 name: site-${{ matrix.site }} 104 62 path: _site 105 63 64 + create-index: 65 + runs-on: ubuntu-latest 66 + needs: discover-sites 67 + steps: 68 + - name: Create root index 69 + run: | 70 + mkdir -p _site 71 + cat > _site/index.html << 'EOF' 72 + <!DOCTYPE html> 73 + <html> 74 + <head> 75 + <title>Sites Index</title> 76 + <style> 77 + body { font-family: system-ui, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; } 78 + h1 { color: #333; } 79 + ul { list-style: none; padding: 0; } 80 + li { margin: 10px 0; } 81 + a { color: #0366d6; text-decoration: none; font-size: 1.1em; } 82 + a:hover { text-decoration: underline; } 83 + </style> 84 + </head> 85 + <body> 86 + <h1>📁 Available Sites</h1> 87 + <ul id="sites-list"></ul> 88 + <script> 89 + const sites = document.getElementById('sites-list'); 90 + fetch('./sites.json') 91 + .then(r => r.json()) 92 + .then(data => { 93 + data.forEach(site => { 94 + const li = document.createElement('li'); 95 + const a = document.createElement('a'); 96 + a.href = './' + site + '/'; 97 + a.textContent = site; 98 + li.appendChild(a); 99 + sites.appendChild(li); 100 + }); 101 + }); 102 + </script> 103 + </body> 104 + </html> 105 + EOF 106 + echo '${{ needs.discover-sites.outputs.sites }}' > _site/sites.json 107 + 108 + - name: Upload index artifact 109 + uses: actions/upload-artifact@v4 110 + with: 111 + name: site-index 112 + path: _site 113 + 106 114 merge-and-deploy: 107 115 runs-on: ubuntu-latest 108 - needs: [discover-sites, build] 116 + needs: [discover-sites, build, create-index] 109 117 steps: 110 118 - name: Download all artifacts 111 119 uses: actions/download-artifact@v4 ··· 114 122 pattern: site-* 115 123 merge-multiple: true 116 124 117 - - name: Create sites index 118 - run: | 119 - echo '${{ needs.discover-sites.outputs.sites }}' > _site/sites.json 120 - 121 125 - name: Upload to GitHub Pages 122 126 uses: actions/upload-pages-artifact@v3 123 127 with: 124 128 path: _site 125 129 126 130 - name: Deploy to GitHub Pages 127 - uses: actions/deploy-pages@v4 131 + uses: actions/deploy-pages@v4