Skip to content

GitHub IPTV 1080 Bot #608

GitHub IPTV 1080 Bot

GitHub IPTV 1080 Bot #608

Workflow file for this run

name: 'GitHub IPTV 1080 Bot'
on:
push:
# push 到main分支时触发
branches: [main]
schedule:
# 每天触发一次
- cron: '0 3 * * *'
jobs:
bot:
runs-on: ubuntu-latest
steps:
# 从仓库获取代码
- name: 'Checkout codes'
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
# 选择要使用的 node 版本
node-version: '14.18.3'
- name: 安装ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v1
- name: '安装IPTV filter'
run: npm install -g iptv-checker
- name: '获取m3u列表'
run: wget https://iptv-org.github.io/iptv/countries/cn.m3u 2>/dev/null -O cn.m3u
# 执行更新代码
- name: 'Update cn m3u'
run: echo "#EXTM3U" > cn1080.m3u
# - name: '从custom_list中添加'
# run: cat custom_list/50fps_4k.m3u custom_list/aqiyi_4k.m3u >> cn1080.m3u
- name: '按黑白名单过滤'
run: python filter_m3u.py >> cn1080.m3u
# TODO: 用更好的方式获取iptv-checker path
# 执行检查
- name: 'IPTV检查'
run: /opt/hostedtoolcache/node/14.18.3/x64/bin/iptv-checker cn1080.m3u -o cn_1080
- name: '移动iptv-checker检查结果'
run: mv cn_1080/online.m3u cn_1080/cn1080.m3u
- name: 'Push branch'
uses: crazy-max/ghaction-github-pages@v2
with:
# 部署到 gh 分支
target_branch: gh
# 部署目录为脚本的输出目录
build_dir: cn_1080
env:
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}