-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.4 KB
/
generate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This is a basic workflow to help you get started with Actions
name: Generate
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
schedule:
- cron: '0 0 */3 * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
env:
OUTPUT_DIR: ../spotify-stats-jbrown1618
SPOTIPY_CLIENT_ID: ${{ secrets.SPOTIPY_CLIENT_ID }}
SPOTIPY_CLIENT_SECRET: ${{ secrets.SPOTIPY_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v3
with:
path: spotify-stats-jbrown1618
- uses: actions/checkout@v3
with:
repository: jbrown1618/spotify-stats
path: spotify-stats
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: 'Run spotify-stats and commit changes'
run: |
cd ./spotify-stats
pip install -r requirements.txt
echo '${{ secrets.SPOTIPY_CACHE }}' > .cache
python main.py
echo 'Finished running spotify-stats'
cd ../spotify-stats-jbrown1618
git config --global user.name 'Josh Brown'
git config --global user.email '[email protected]'
git add -A
git commit -m '[Automated] Update with latest data'
git push