Sample related artists #401
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: Sample related artists | |
on: | |
workflow_dispatch: | |
inputs: | |
sample_count: | |
description: 'Number of artists to sample' | |
default: '50' | |
schedule: | |
- cron: '47 12 * * *' | |
env: | |
CLIENT_IDS: ${{secrets.CLIENT_IDS}} | |
CLIENT_SECRETS: ${{secrets.CLIENT_SECRETS}} | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' | |
bundler-cache: true | |
- name: Install gems | |
run: bundle install | |
- name: Sync data | |
run: ruby scripts/sample_related_artists.rb ${{github.event.inputs.sample_count}} | |
- name: Commit and push | |
run: |- | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add input/ | |
timestamp=$(ruby -e "require 'date'; puts DateTime.now.iso8601") | |
git commit -m "Sample related artists ${timestamp}" || exit 0 | |
git push |