Skip to content

channels-epg-merge #817

channels-epg-merge

channels-epg-merge #817

Workflow file for this run

name: channels-epg-merge
on:
schedule:
- cron: '5 */12 * * *'
workflow_dispatch:
jobs:
backup-and-merge:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Run backup and merge
run: cd epgs && python backup_and_merge.py
- name: Commit and push changes
run: |
git config --global user.name "actions-user"
git config --global user.email "actions@github.com"
git add epgs/daddylive-channels-epg_z1.xml epgs/daddylive-channels-epg_z2.xml epgs/daddylive-channels-epg_z3.xml epgs/guide.xml
git diff --staged --quiet || git commit -m "Update channels epg"
git push --force
push-to-uncle-fox-epg:
needs: backup-and-merge
runs-on: ubuntu-latest
steps:
- name: Checkout generated XML from source repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Copy XML file to temp directory
run: |
mkdir tmp_epg
cp epgs/daddylive-channels-epg.xml tmp_epg/single.xml
cp epgs/guide.xml tmp_epg/guide.xml
- name: Checkout Uncle-Fox-EPG repository
uses: actions/checkout@v3
with:
repository: J-Lich/Uncle-Fox-EPG
token: ${{ secrets.REPO_TOKEN }}
ref: main
path: uncle-fox-epg
- name: Copy XML file into Uncle-Fox-EPG repo
run: |
mkdir -p uncle-fox-epg/external/
cp tmp_epg/single.xml uncle-fox-epg/external/single.xml
cp tmp_epg/guide.xml uncle-fox-epg/external/guide.xml
- name: Commit and push XML file to Uncle-Fox-EPG
working-directory: uncle-fox-epg
run: |
git config --global user.name "actions-user"
git config --global user.email "actions@github.com"
git add external/single.xml external/guide.xml
git commit -m "Add new EPG XML file [CI skip]" || echo "No changes to commit"
git push