47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: auto-update
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- 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
|
|
- name: Install Dependencies
|
|
run: npm install
|
|
- name: Remove Duplicates
|
|
run: node scripts/remove-duplicates.js
|
|
- name: Commit Changes
|
|
run: |
|
|
git add channels/*
|
|
git diff-index --quiet HEAD || git commit -m "[Bot] Remove duplicates"
|
|
- name: Format Playlists
|
|
run: node scripts/format.js
|
|
- name: Commit Changes
|
|
run: |
|
|
git add channels/*
|
|
git diff-index --quiet HEAD || git commit -m "[Bot] Format playlists"
|
|
- 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
|
|
- name: Update README.md
|
|
run: node scripts/update-readme.js
|
|
- name: Commit Changes
|
|
run: |
|
|
git add README.md
|
|
git diff-index --quiet HEAD || git commit -m "[Bot] Update README.md"
|