-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.33 KB
/
python-app.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
name: Update file(s)
on:
push:
branches: [ main ]
schedule:
- cron: "0 */6 * * *" # every 6 hours
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
if [ -f requirements_run.txt ]; then pip install -r requirements_run.txt; fi
- name: Install newspaper
run: |
git clone https://github.com/dailydotdev/newspaper
cd newspaper
pip install -r requirements.txt
python setup.py install
cd ..
- name: Format code
run: black run.py
- name: Fetch data and update the file(s)
run: python run.py
# - name: Classify the data
# run: python classify.py
- name: Commit updated file(s) back to this repository
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git diff-index --quiet HEAD || git commit -m "[skip ci] Save result of action"
git fetch origin main
git push origin HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.SECRET_GH }}