Skip to content

Commit

Permalink
Update coupons_fetch.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AKhilRaghav0 authored Aug 4, 2023
1 parent f44bf10 commit 133f300
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions .github/workflows/coupons_fetch.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
name: Udemy Coupons Fetcher

on: workflow_dispatch
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
# For Debug into the runner image
# - name: Start tmate session
# uses: mxschmitt/action-tmate@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- 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: 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: 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 }}

0 comments on commit 133f300

Please sign in to comment.