-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.47 KB
/
qod.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
name: Quote of Day Generator
on:
push:
paths:
- "apps/qod/**"
workflow_dispatch:
schedule:
- cron: '30 20 * * *'
jobs:
generate_qod:
name: Generate QoD
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python Environment
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: x64
- name: Install Libraries
run: |
pip install -r apps/qod/requirements.txt
mkdir cache
wget -O cache/smiley-sans.zip https://github.com/atelier-anchor/smiley-sans/releases/download/v1.1.1/smiley-sans-v1.1.1.zip
wget -O cache/pexels_logo.png --header="User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11" "https://images.pexels.com/lib/api/pexels-white.png"
unzip cache/smiley-sans.zip -d cache
- name: Generate QoD
env:
PEXELS_API_KEY: ${{ secrets.PEXELS_API_KEY }}
run: |
python apps/qod/main.py
- name: Commit Changes
run: |
git config user.name woshishabii
git config user.email [email protected]
git add .
git commit -m "QoD Generator: `date "+%Y-%m-%d %H:%M:%S UTC%:z"`" || true
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}