-
-
Notifications
You must be signed in to change notification settings - Fork 5
41 lines (35 loc) · 1.41 KB
/
run_workflow.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
name: run_workflow
on:
schedule:
# Runs everyday at:
# 12:15 AM UTC (GMT0:00) -> 06:00 AM Nepal Time (GMT+5:45)
- cron: "15 00 * * *"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checks-out this current repository
uses: actions/checkout@v3
- name: Setup a specific version of python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Add new stocks or announcements and publish to telegram channel
env:
ALLOTMENT_URL: ${{ secrets.ALLOTMENT_URL }}
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CHANNEL: ${{ secrets.CHANNEL }}
API_URL: ${{ secrets.API_URL }}
run: |
python run.py
- name: Commit only if new stocks have been added
run: |
git config --global user.email "[email protected]"
git config --global user.name "stonksbot"
git diff --quiet || (git add nepstonks.db && git commit -m "🌱 db: add new stocks")
git push origin HEAD:main