mirror of
https://github.com/theariatv/theariatv.github.io.git
synced 2026-11-19 14:18:27 +01:00
Add GitHub Actions workflow for M3U playlist generation
This workflow generates M3U playlists on push or pull request events, using a Python script and commits the generated files back to the repository.
This commit is contained in:
parent
22e19b6e0b
commit
6110184463
1 changed files with 46 additions and 0 deletions
46
.github/workflows/generate_playlists.yml
vendored
Normal file
46
.github/workflows/generate_playlists.yml
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
name: Generate M3U Playlists
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths:
|
||||
- 'channels/**'
|
||||
- 'generator.py'
|
||||
- '.github/workflows/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths:
|
||||
- 'channels/**'
|
||||
- 'generator.py'
|
||||
|
||||
jobs:
|
||||
generate-playlists:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Required permissions to allow GitHub Actions to push changes back to the repository
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Run playlist generator
|
||||
run: python generator.py
|
||||
|
||||
- name: Commit and push generated M3U files (Push events only)
|
||||
if: github.event_name == 'push'
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "chore: auto-update m3u playlists [skip ci]"
|
||||
file_pattern: main/
|
||||
branch: ${{ github.head_ref || github.ref_name }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue