added github action to build playlist ever six hours #5
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 index.html" | |
| on: | |
| schedule: | |
| - cron: "* */6 * * *" | |
| push: | |
| branches: | |
| - "main" | |
| jobs: | |
| update-index-html: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Run build mfp index.html script | |
| run: python build-mfp-index-html.py | |
| - name: Commit and push | |
| run: | | |
| git diff --quiet index.html | |
| if [ "$?" -eq 1 ]; | |
| then | |
| echo "Changes detected in playlist. Publishing..." | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add index.html | |
| git commit -m "Update mfp; playlist with latest content." | |
| git push | |
| else | |
| echo "No changes detected in playlist. Skipping publish..." | |
| fi |