iptv/.github/workflows/auto-update.yml
2021-05-26 16:49:59 +03:00

96 lines
2.6 KiB
YAML

name: auto-update
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
remove-duplicates:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Dependencies
run: npm install
- name: Remove Duplicates
run: node scripts/remove-duplicates.js
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: channels
path: channels/
format:
runs-on: ubuntu-latest
needs: remove-duplicates
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Install Dependencies
run: npm install
- name: Format Playlists
run: node scripts/format.js
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: channels
path: channels/
generate:
runs-on: ubuntu-latest
needs: format
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Install Dependencies
run: npm install
- name: Generate Playlists
run: node scripts/generate.js
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages
folder: .gh-pages
update-readme:
runs-on: ubuntu-latest
needs: generate
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Install Dependencies
run: npm install
- name: Update README.md
run: node scripts/update-readme.js
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: README.md
path: README.md
pull-request:
needs: update-readme
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download /channels
uses: actions/download-artifact@v2
with:
name: channels
path: channels/
- name: Download README.md
uses: actions/download-artifact@v2
with:
name: README.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: '[Bot] Update playlists'
body: |
This pull request is created automatically by `auto-update` action.
commit-message: '[Bot] Update playlists'
branch: bot/auto-update
delete-branch: true