Create Randomized Spotify Playlist #30
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: Create Randomized Spotify Playlist | |
on: | |
schedule: | |
- cron: '0 0 * * MON' # Runs every Monday | |
workflow_dispatch: # Allows manual trigger | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: # Setting environment variables using secrets | |
SPOTIPY_CLIENT_ID: ${{ secrets.SPOTIPY_CLIENT_ID }} | |
SPOTIPY_CLIENT_SECRET: ${{ secrets.SPOTIPY_CLIENT_SECRET }} | |
SPOTIPY_REFRESH_TOKEN: ${{ secrets.SPOTIPY_REFRESH_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: pip install spotipy pandas | |
- name: Run script | |
run: python script.py | |
- name: Save CSV as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: selected_tracks.csv | |
path: ./selected_tracks.csv | |
- name: Print it worked | |
run: echo "It's working! Enjoy :)" |