add reactive-resume status, update build script

This commit is contained in:
Sam Heinz
2025-05-13 00:30:39 +10:00
parent 14ccfdd04b
commit c45b4f1b0f
3 changed files with 357 additions and 6 deletions

View File

@@ -1,5 +1,3 @@
# Based on https://github.com/actions/starter-workflows/blob/main/pages/nextjs.yml
name: Frontend CI/CD
on:
@@ -35,6 +33,31 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Update JSON statuses
run: |
JSON_DIR=public/json
STATUS_FILE="$JSON_DIR/statuses.json"
for file in "$JSON_DIR"/*.json; do
filename=$(basename "$file")
# skip the generated statuses.json itself
if [[ "$filename" == "statuses.json" ]]; then
continue
fi
# pull status from statuses.json; skip if null or empty
status=$(jq -r --arg key "$filename" '.[$key] // empty' "$STATUS_FILE")
if [[ -n "$status" ]]; then
# inject/update top-level "status" field
jq --arg st "$status" '.status = $st' "$file" > "$file.tmp"
mv "$file.tmp" "$file"
echo "→ Updated $filename with status: $status"
fi
done
- name: Setup Node
uses: actions/setup-node@v4
with: