Skip to content

fetch_lyrics

fetch_lyrics #356

Workflow file for this run

name: Fetch Lyrics
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
inputs:
retry_failed_lyrics:
description: 'retry_failed_lyrics'
type: boolean
required: false
default: false
max_count:
description: 'max_count'
type: string
required: false
default: '2000'
lyrics:
description: 'lyrics'
type: string
required: false
default: ''
repository_dispatch:
types: [fetch_lyrics]
jobs:
Fetch_Lyrics:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: lyrics
submodules: true
- name: Checkout submodules to latest
run: |
git submodule set-branch --branch master Playlists
git submodule update --remote --checkout --depth 0
- name: Execute Lyrics (workflow_dispatch)
if: ${{ github.event_name == 'workflow_dispatch' }}
env:
RETRY_FAILED_LYRICS: ${{ github.event.inputs.retry_failed_lyrics }}
MAX_COUNT: ${{ github.event.inputs.max_count }}
LYRICS: ${{ github.event.inputs.lyrics }}
run: |
chmod -R a+w Lyrics
chmod a+w Lyrics.json
docker run -v .:/output -v $PWD/appsettings.json:/app/appsettings.json ghcr.io/youtubeclipplaylist/lyrics
- name: Execute Lyrics (repository_dispatch)
if: ${{ github.event_name == 'repository_dispatch' }}
env:
RETRY_FAILED_LYRICS: ${{ github.event.client_payload.retry_failed_lyrics }}
MAX_COUNT: ${{ github.event.client_payload.max_count }}
LYRICS: ${{ github.event.client_payload.lyrics }}
run: |
chmod -R a+w Lyrics
chmod a+w Lyrics.json
docker run -v .:/output -v $PWD/appsettings.json:/app/appsettings.json ghcr.io/youtubeclipplaylist/lyrics
- name: Execute Lyrics (schedule, push)
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' }}
run: |
chmod -R a+w Lyrics
chmod a+w Lyrics.json
docker run -v .:/output -v $PWD/appsettings.json:/app/appsettings.json ghcr.io/youtubeclipplaylist/lyrics
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: lyrics
file_pattern: Lyrics Lyrics.json
skip_checkout: true
commit_message: 'Github Action: Fetch Lyrics'
commit_user_name: Github Action Bot # defaults to "GitHub Actions"
commit_author: Github Action Bot <[email protected]> # defaults to author of the commit that triggered the run