Update auto-update.yml

This commit is contained in:
Aleksandr Statciuk 2021-08-02 04:13:25 +03:00
parent dce06bfa8a
commit a79edce7b1
1 changed files with 48 additions and 31 deletions

View File

@ -4,54 +4,64 @@ on:
schedule: schedule:
- cron: '0 0 * * *' - cron: '0 0 * * *'
jobs: jobs:
remove-duplicates: create-branch:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Create Branch
run: git branch bot/auto-update && git push
remove-duplicates:
runs-on: ubuntu-latest
needs: create-branch
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: bot/auto-update
- name: Install Dependencies - name: Install Dependencies
run: npm install run: npm install
- name: Remove Duplicates - name: Remove Duplicates
run: node scripts/remove-duplicates.js run: node scripts/remove-duplicates.js
- name: Upload Artifact - name: Commit Changes
uses: actions/upload-artifact@v2 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
name: channels commit_message: '[Bot] Removed duplicates'
path: channels/ branch: bot/auto-update
filter: filter:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: remove-duplicates needs: remove-duplicates
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Download Artifacts with:
uses: actions/download-artifact@v2 ref: bot/auto-update
- name: Install Dependencies - name: Install Dependencies
run: npm install run: npm install
- name: Filter Playlists - name: Filter Playlists
run: node scripts/filter.js run: node scripts/filter.js
- name: Upload Artifact - name: Commit Changes
uses: actions/upload-artifact@v2 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
name: channels commit_message: '[Bot] Filtered channels'
path: channels/ branch: bot/auto-update
format: format:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: filter needs: filter
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Download Artifacts with:
uses: actions/download-artifact@v2 ref: bot/auto-update
- name: Install Dependencies - name: Install Dependencies
run: npm install run: npm install
- name: Format Playlists - name: Format Playlists
run: node scripts/format.js run: node scripts/format.js
- name: Upload Artifact - name: Commit Changes
uses: actions/upload-artifact@v2 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
name: channels commit_message: '[Bot] Formated playlists'
path: channels/ branch: bot/auto-update
detect-resolution: detect-resolution:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: format needs: format
@ -224,8 +234,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Download Artifacts with:
uses: actions/download-artifact@v2 ref: bot/auto-update
- name: Install Dependencies - name: Install Dependencies
run: npm install run: npm install
- name: Detect Resolution - name: Detect Resolution
@ -235,14 +245,29 @@ jobs:
with: with:
name: channels name: channels
path: channels/${{ matrix.country }}.m3u path: channels/${{ matrix.country }}.m3u
generate: commit-changes:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: detect-resolution needs: detect-resolution
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
ref: bot/auto-update
- name: Download Artifacts - name: Download Artifacts
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[Bot] Detected resolution'
branch: bot/auto-update
generate:
runs-on: ubuntu-latest
needs: commit-changes
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: bot/auto-update
- name: Install Dependencies - name: Install Dependencies
run: npm install run: npm install
- name: Generate Playlists - name: Generate Playlists
@ -258,8 +283,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Download Artifacts with:
uses: actions/download-artifact@v2 ref: bot/auto-update
- name: Install Dependencies - name: Install Dependencies
run: npm install run: npm install
- name: Update README.md - name: Update README.md
@ -275,15 +300,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Download /channels
uses: actions/download-artifact@v2
with: with:
name: channels ref: bot/auto-update
path: channels/
- name: Download README.md
uses: actions/download-artifact@v2
with:
name: README.md
- name: Generate Token - name: Generate Token
uses: tibdex/github-app-token@v1 uses: tibdex/github-app-token@v1
id: generate-token id: generate-token
@ -297,7 +315,6 @@ jobs:
title: '[Bot] Update playlists' title: '[Bot] Update playlists'
body: | body: |
This pull request is created automatically by `auto-update` action. This pull request is created automatically by `auto-update` action.
commit-message: '[Bot] Update playlists'
committer: GitHub <noreply@github.com> committer: GitHub <noreply@github.com>
branch: bot/auto-update branch: bot/auto-update
delete-branch: true delete-branch: true