-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (58 loc) · 1.96 KB
/
python-app.yml
File metadata and controls
71 lines (58 loc) · 1.96 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Spotify Playlist Backup
on:
# schedule:
# - cron: '0 3 * * 2'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/labeler@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Fetch Playlists from Spotify
env:
# Part of the webdriver manager - needs GH_TOKEN so the github driver download doesn't timeout
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }}
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
SPOTIFY_USERNAME: ${{ secrets.SPOTIFY_USERNAME }}
SPOTIFY_PASSWORD: ${{ secrets.SPOTIFY_PASSWORD }}
run: python script.py
- name: Setup Git Config
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Commit Updates
run: |
# Stage the file, commit and push
git add -A
git commit -m "💿 updated spotify playlists via github action" -a
- name: push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main