2021-02-08 12:05:46 +01:00
|
|
|
name: auto-update
|
2021-02-08 11:53:24 +01:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
|
|
|
jobs:
|
2021-05-26 14:28:57 +02:00
|
|
|
update:
|
2021-05-06 15:24:54 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2021-05-26 14:28:57 +02:00
|
|
|
- name: Update Config
|
|
|
|
run: |
|
|
|
|
git config user.name github-actions
|
|
|
|
git config user.email github-actions@github.com
|
|
|
|
- name: Create Branch
|
|
|
|
run: |
|
|
|
|
git fetch --prune --unshallow
|
|
|
|
git checkout bot/auto-update || git checkout -b bot/auto-update
|
2021-05-06 15:24:54 +02:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: npm install
|
|
|
|
- name: Remove Duplicates
|
|
|
|
run: node scripts/remove-duplicates.js
|
|
|
|
- name: Commit Changes
|
|
|
|
run: |
|
2021-05-26 13:31:11 +02:00
|
|
|
git add channels/*
|
2021-05-26 13:26:11 +02:00
|
|
|
git diff-index --quiet HEAD || git commit -m "[Bot] Remove duplicates"
|
2021-02-08 11:53:24 +01:00
|
|
|
- name: Format Playlists
|
2021-05-07 02:37:00 +02:00
|
|
|
run: node scripts/format.js
|
2021-05-06 15:24:54 +02:00
|
|
|
- name: Commit Changes
|
|
|
|
run: |
|
2021-05-26 13:31:11 +02:00
|
|
|
git add channels/*
|
2021-05-26 13:26:11 +02:00
|
|
|
git diff-index --quiet HEAD || git commit -m "[Bot] Format playlists"
|
2021-02-08 11:53:24 +01:00
|
|
|
- name: Generate Playlists
|
|
|
|
run: node scripts/generate.js
|
|
|
|
- name: Deploy to GitHub Pages
|
2021-04-17 02:47:33 +02:00
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.1
|
2021-04-17 02:53:32 +02:00
|
|
|
with:
|
|
|
|
branch: gh-pages
|
|
|
|
folder: .gh-pages
|
2021-02-08 11:53:24 +01:00
|
|
|
- name: Update README.md
|
|
|
|
run: node scripts/update-readme.js
|
2021-02-09 08:05:21 +01:00
|
|
|
- name: Commit Changes
|
|
|
|
run: |
|
2021-05-26 13:31:11 +02:00
|
|
|
git add README.md
|
2021-05-26 13:26:11 +02:00
|
|
|
git diff-index --quiet HEAD || git commit -m "[Bot] Update README.md"
|
2021-05-26 14:37:13 +02:00
|
|
|
- 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.
|
|
|
|
base: bot/auto-update
|
|
|
|
branch: bot/auto-update-pr
|
|
|
|
delete-branch: true
|