fix: inline manifest JSON into form args instead of uploading as separate file

This commit is contained in:
zwitschi committed 2026-08-10 21:35:02 +02:00
1 parent c0356a26f6
commit 4d627e13b9
1 file changed
+7 -23
+7 -23
View File
@@ -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")