-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (55 loc) · 1.84 KB
/
cron.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Daily Game Notifications
on:
schedule:
# * is a special character in YAML so you have to quote this string
# We'll run this daily at noon.
- cron: '0 10 * 4-9 * '
workflow_dispatch:
jobs:
process-data:
runs-on: ubuntu-20.04
steps:
# Shallow should be fine for video
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install awscli
- name: Fetch Data
run: |
python what2watch.py
python what2watch.py --html --github-pages
- name: Commit
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Actions Bot"
git add data/
git add docs/
git commit -a -m 'Automated commit'
git push
continue-on-error: true
- name: Toot
run: |
python what2watch.py --toot
env:
FEDI_ACCESS_TOKEN: ${{ secrets.FEDI_ACCESS_TOKEN }}
- name: Email
run: |
aws ses send-email --destination "ToAddresses=${DISTRIBUTION_LIST}" --from [email protected] --subject 'MLB: What2Watch' --html "$(python what2watch.py --html)"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SES_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SES_ACCESS_SECRET }}
AWS_DEFAULT_REGION: eu-central-1
DISTRIBUTION_LIST: ${{ secrets.DISTRIBUTION_LIST }}