Archive Discover Weekly Playlist #71
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: Archive Discover Weekly Playlist | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
schedule: | |
# Run Mondays at 7:57 | |
- cron: "57 7 * * 1" | |
jobs: | |
archive_discover_weekly: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
cache: 'pip' | |
- name: Install Python deps | |
run: pip install -r requirements.txt | |
- name: Get playlist ID | |
shell: bash | |
env: | |
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }} | |
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }} | |
SPOTIFY_ACCESS_TOKEN: ${{ secrets.SPOTIFY_ACCESS_TOKEN }} | |
SPOTIFY_REFRESH_TOKEN: ${{ secrets.SPOTIFY_REFRESH_TOKEN }} | |
run: > | |
echo "SPOTIFY_PLAYLIST_ID=$( | |
python scripts/get-playlist-id.py "$SPOTIFY_CLIENT_ID" "$SPOTIFY_CLIENT_SECRET" "$SPOTIFY_ACCESS_TOKEN" "$SPOTIFY_REFRESH_TOKEN" 'Discover Weekly' 'Découvertes de la semaine' 'Découvertes hebdomadaires' 'Descubrimiento semanal' 'Descobertas da Semana' 'Descubrimiento semanal' 'اكتشف هذا الأسبوع' 'Открытиях недели' | |
)" >> $GITHUB_ENV | |
- name: Copy playlist | |
shell: bash | |
env: | |
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }} | |
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }} | |
SPOTIFY_ACCESS_TOKEN: ${{ secrets.SPOTIFY_ACCESS_TOKEN }} | |
SPOTIFY_REFRESH_TOKEN: ${{ secrets.SPOTIFY_REFRESH_TOKEN }} | |
run: > | |
python scripts/copy-playlist.py | |
"$SPOTIFY_CLIENT_ID" "$SPOTIFY_CLIENT_SECRET" | |
"$SPOTIFY_ACCESS_TOKEN" "$SPOTIFY_REFRESH_TOKEN" | |
"$SPOTIFY_PLAYLIST_ID" "DW - %b %e" |