-
-
Notifications
You must be signed in to change notification settings - Fork 5
40 lines (33 loc) · 1.07 KB
/
coupons_fetch.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
name: Udemy Coupons Fetcher
on:
workflow_dispatch:
# Add the following schedule to run the workflow every 24 hours
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Python script
run: python ucf_ci.py
working-directory: ${{ github.workspace }}
- name: Save coupons.txt as artifact
uses: actions/upload-artifact@v3
with:
name: coupons
path: coupons.txt
- name: Upload to Telegram
run: |
BOT_TOKEN="${{ secrets.TELEGRAM_BOT_TOKEN }}"
CHAT_ID="${{ secrets.TELEGRAM_CHAT_ID }}"
curl -F [email protected] "https://api.telegram.org/bot${BOT_TOKEN}/sendDocument?chat_id=${CHAT_ID}"
env:
BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}