-
-
Notifications
You must be signed in to change notification settings - Fork 17
42 lines (41 loc) · 1.18 KB
/
update.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
on:
workflow_dispatch:
schedule:
- cron: '8 18 * * *'
- cron: '8 19 * * *'
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: ./bin/update-playlist README.md
env:
YOUTUBE_PLAYLIST_ID: PLWBKAf81pmOaP9naRiNAqug6EBnkPakvY
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
- run: |
if git diff --quiet; then
exit 0
fi
git -c user.name='Anthony Sottile' -c user.email=asottile@umich.edu commit -a -m 'update playlist'
git push origin HEAD
- uses: actions/checkout@v3
with:
ref: gh-pages
path: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
- run: ./bin/playlist-json gh-pages/playlists.json
env:
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
- run: |
if git diff --quiet; then
exit 0
fi
git -c user.name='Anthony Sottile' -c user.email=asottile@umich.edu commit -a -m 'update playlist'
git push origin HEAD
working-directory: gh-pages