Generate IPTVFast playlists #322
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: Generate IPTVFast playlists | |
| on: | |
| schedule: | |
| - cron: "0 */6 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| actions: read | |
| concurrency: | |
| group: iptvfast-generate | |
| cancel-in-progress: false | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| env: | |
| IPTVFAST_CONCURRENCY: "32" | |
| IPTVFAST_TIMEOUT: "25" | |
| IPTVFAST_RESOLVE_REDIRECTS: "true" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Generate playlists | |
| run: python -m iptvfast.generate | |
| - name: Upload output artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: iptvfast-output | |
| path: output/ | |
| if-no-files-found: error | |
| retention-days: 30 | |
| - name: Commit generated files to repository | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add output/ | |
| if git diff --cached --quiet; then | |
| echo "No generated changes to commit." | |
| else | |
| git commit -m "Update generated IPTVFast playlists" | |
| git pull --rebase origin "${GITHUB_REF_NAME}" | |
| git push origin "HEAD:${GITHUB_REF_NAME}" | |
| fi |