Regenerate Pronunciations #210
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Regenerate Pronunciations' | |
'on': | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'tooling/additional_pronounciations.dict' | |
schedule: | |
- cron: '0 0 */14 * *' | |
workflow_dispatch: {} | |
jobs: | |
cancelCurrentRuns: | |
name: 'Cancel in-progress Workflow runs' | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- name: 'Cancel in-progress Workflow runs' | |
uses: 'styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa' | |
with: | |
access_token: '${{ secrets.GITHUB_TOKEN }}' | |
generation: | |
name: 'Generation' | |
needs: | |
- 'cancelCurrentRuns' | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- name: 'Checkout the current branch' | |
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11' | |
with: | |
fetch-depth: 0 | |
token: '${{ secrets.LYRICISTANT_TOKEN }}' | |
- name: 'Setup Node.js - 15.x.x' | |
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8' | |
with: | |
node-version: '>=15.10' | |
cache: 'npm' | |
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9' | |
name: 'Cache Node Modules' | |
with: | |
path: '~/.npm' | |
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}' | |
restore-keys: '${{ runner.os }}-node-' | |
- name: 'Install Node modules' | |
run: 'npm ci' | |
- name: 'Setup Git author' | |
run: 'git config --local user.name ''github-actions'' && git config --local user.email ''41898282+github-actions[bot]@users.noreply.github.com''' | |
- name: 'Generate pronunciations' | |
run: 'tooling/create_pronunciations.ts' | |
- name: 'Create & push changes if there are any' | |
run: 'git diff --quiet && git diff --staged --quiet || (git commit --no-verify --all -m "chore: update pronunciations" && git push --no-verify)' |