feat: pull my own artist charts

This commit is contained in:
Cory Dransfeldt 2024-04-08 16:45:39 -07:00
parent 5fb630aaf8
commit 982e479812
No known key found for this signature in database
6 changed files with 27 additions and 58 deletions

View file

@ -1,30 +0,0 @@
name: Fetch weekly artist charts
on:
workflow_dispatch:
schedule:
- cron: '00 09 * * 5'
jobs:
FetchArtistCharts:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout out this repo
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Fetch charts
run: |
echo "CHART_DATA=$(curl 'https://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=coryd_&api_key=${{ secrets.LASTFM_API_KEY }}&format=json')" >> "$GITHUB_ENV"
- name: Update charts
run: |
echo "CHARTS=$(cat src/_data/json/weekly-artist-charts.json | jq -c --argjson jq_data "$CHART_DATA" '.charts += [$jq_data]')" >> "$GITHUB_ENV"
- name: Write charts
run: |
echo $CHARTS > src/_data/json/weekly-artist-charts.json
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update artist charts for the week.
commit_user_name: cdransf
commit_user_email: coryd@hey.com