40 lines
912 B
YAML
40 lines
912 B
YAML
name: Update IPTV Playlist
|
||
|
||
on:
|
||
schedule:
|
||
# 每天 UTC 02:00(北京时间 10:00)
|
||
- cron: "0 2 * * *"
|
||
workflow_dispatch:
|
||
|
||
permissions:
|
||
contents: write
|
||
|
||
jobs:
|
||
update:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Set up Python
|
||
uses: actions/setup-python@v5
|
||
with:
|
||
python-version: "3.11"
|
||
|
||
- name: Install dependencies
|
||
run: pip install -r requirements.txt
|
||
|
||
- name: Run AVTV
|
||
run: python main.py
|
||
|
||
- name: Commit and push
|
||
run: |
|
||
git config user.name "github-actions[bot]"
|
||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||
git add output/avtv.m3u
|
||
if git diff --cached --quiet; then
|
||
echo "No changes"
|
||
else
|
||
git commit -m "chore: update playlist $(date -u +%Y-%m-%d)"
|
||
git push
|
||
fi
|