-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (73 loc) · 2.63 KB
/
FetchLyrics.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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