Update index.html #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build posters.json | ||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| paths: | ||
| - 'Posters/**' | ||
| - '.github/workflows/posters-manifest.yml' | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Generate posters.json | ||
| run: | | ||
| set -e | ||
| echo "[]" > posters.json | ||
| # Collect poster files | ||
| python - << 'PY' | ||
| import os, json, sys | ||
| valid = {'.pdf','.png','.jpg','.jpeg','.webp','.svg'} | ||
| out = [] | ||
| for root, dirs, files in os.walk('Posters'): | ||
| for f in files: | ||
| ext = os.path.splitext(f)[1].lower() | ||
| if ext in valid: | ||
| p = os.path.join(root, f).replace('\\','/') | ||
| out.append(p) | ||
| out.sort(key=str.lower) | ||
| with open('posters.json','w', encoding='utf-8') as fh: | ||
| json.dump(out, fh, indent=2) | ||
| print(f"Wrote {len(out)} entries to posters.json") | ||
| PY | ||
| - name: Commit posters.json | ||
| run: | | ||
| if git diff --quiet posters.json; then | ||
| echo "No changes in posters.json" | ||
| else | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git add posters.json | ||
| git commit -m "chore: update posters.json [skip ci]" | ||
| git push | ||
| fi | ||