-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (53 loc) · 1.69 KB
/
spotifyExportTracks.yaml
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
name: Spotify Export Tracks
on:
schedule:
# 在北京时间每周日晚上10点执行(UTC时间每周日14:00)
- cron: '0 14 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
with:
ref: 'spotifyTracks'
continue-on-error: true
- run: |
mkdir tmp
if [ -f spotifyTracks-full.txt ]; then
cp spotifyTracks-full.txt tmp/spotifyTracks-full.txt
cp spotifyTracks-unplayable.txt tmp/spotifyTracks-unplayable.txt
fi
ls tmp
- run: |
git fetch --depth 1 origin main:main
git branch
git checkout main
ls tmp
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- run: pnpm i --frozen-lockfile
- name: Run spotifyExportTracks.ts
env:
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }}
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
SPOTIFY_REFRESH_TOKEN: ${{ secrets.SPOTIFY_REFRESH_TOKEN }}
SPOTIFY_T2S_ENABLE: ${{ vars.SPOTIFY_T2S_ENABLE }}
T2S_PHRASES: ${{ vars.T2S_PHRASES }}
NOTIFY_URL: ${{ secrets.NOTIFY_URL }}
run: pnpm spotifyExportTracks
- name: Push to branch
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: spotifyTracks
folder: data