From 4d627e13b9a3d46a3596169f04c18a04bff132ba Mon Sep 17 00:00:00 2001 From: zwitschi Date: Mon, 10 Aug 2026 21:35:02 +0200 Subject: [PATCH] fix: inline manifest JSON into form args instead of uploading as separate file --- .gitea/workflows/pages-deploy.yml | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/pages-deploy.yml b/.gitea/workflows/pages-deploy.yml index 58ff86f..f9a4e68 100644 --- a/.gitea/workflows/pages-deploy.yml +++ b/.gitea/workflows/pages-deploy.yml @@ -28,20 +28,14 @@ jobs: - name: Generate deployment manifest run: | cd frontend/dist - echo "{" > manifest.json - first=true - for file in $(find . -type f | sed 's|^\./||'); do + form_args="-F manifest={" + for file in $(find . -type f ! -name manifest.json | sed 's|^\./||'); do hash=$(sha256sum "$file" | awk '{print $1}') - if [ "$first" = true ]; then - first=false - else - echo "," >> manifest.json - fi - printf ' "%s": "%s"' "$file" "$hash" >> manifest.json + form_args="$form_args\"$file\":\"$hash\"," done - echo "" >> manifest.json - echo "}" >> manifest.json - echo "Generated manifest with $(grep -c ':' manifest.json) files" + form_args="${form_args%,}}" # remove trailing comma and close JSON + echo "Form arguments: $form_args" + echo "FORM_ARGS=$form_args" >> $GITHUB_ENV - name: Deploy to Cloudflare Pages env: @@ -49,17 +43,7 @@ jobs: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | cd frontend/dist - - # Build multipart form arguments from all files + manifest - form_args="-F manifest=@manifest.json" - for file in $(find . -type f ! -name manifest.json | sed 's|^\./||'); do - form_args="$form_args -F $file=@$file" - done - - # print the form arguments for debugging - echo "Form arguments:" - echo "$form_args" | tr ' ' '\n' | sed 's/^/- /' - + form_args="$FORM_ARGS" # use form arguments generated in previous step # Get short commit hash for deployment metadata COMMIT_HASH=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") COMMIT_MSG=$(git log -1 --pretty=%B 2>/dev/null | head -1 || echo "Gitea Actions deploy")