commit db1958e622709328b8ec734687f79d1d5bdee1c4 parent f76c06c2909740c3a85aa41995dc878415dc3ae7 Author: minerva-jupiter <ryouturn@gmail.com> Date: Wed, 9 Sep 2026 04:58:54 +0900 ci(workflow): add step to purge oversized HTML files for Cloudflare Pages Diffstat:
| M | .github/workflows/stagit-build.yml | | | 32 | ++++++++++++++++++++++++++++++++ |
1 file changed, 32 insertions(+), 0 deletions(-)
diff --git a/.github/workflows/stagit-build.yml b/.github/workflows/stagit-build.yml @@ -58,6 +58,38 @@ jobs: (cd "${ROOT_DIR}/repositories" && stagit-index *.git > "${ROOT_DIR}/html/index.html") + - name: Purge oversized HTML files for Cloudflare Pages + run: | + echo "Checking for files larger than 20MB..." + + # 20MBを超えるHTMLファイルを検出して置換 + find html -type f -size +20M -name "*.html" | while read -r file; do + filesize=$(du -h "$file" | cut -f1) + echo "PURGING: $file ($filesize) exceeds Cloudflare Pages limits." + + cat << 'EOF' > "$file" + <!DOCTYPE html> + <html> + <head> + <meta charset="utf-8"> + <title>File Truncated</title> + <style> + body { font-family: sans-serif; margin: 2em; background: #fdf6e3; color: #657b83; } + .box { border: 2px solid #dc322f; padding: 1.5em; border-radius: 4px; background: #fff; } + h1 { color: #dc322f; margin-top: 0; } + </style> + </head> + <body> + <div class="box"> + <h1>⚠️ Diff/File Exceeds Size Limit</h1> + <p>This page was omitted from the static build because its generated size exceeds Cloudflare Pages' 25MB single-file limit.</p> + <p>Please inspect this commit or file locally in your git clone.</p> + </div> + </body> + </html> + EOF + done + - name: Push ./html to gh-pages branch env: GH_TOKEN: ${{ secrets.PORTAL_PAT }}