Aqsa Kausar
commited on
Create trends.yml
Browse files- .github/workflows/trends.yml +44 -0
.github/workflows/trends.yml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Run trend graph Script
|
2 |
+
|
3 |
+
on:
|
4 |
+
workflow_dispatch:
|
5 |
+
schedule:
|
6 |
+
# Run every 30 minutes
|
7 |
+
#- cron: '*/30 * * * *'
|
8 |
+
- cron: '0 0 * * 0'
|
9 |
+
|
10 |
+
jobs:
|
11 |
+
run-scraper:
|
12 |
+
runs-on: ubuntu-latest
|
13 |
+
|
14 |
+
steps:
|
15 |
+
- name: Checkout repository
|
16 |
+
uses: actions/checkout@v3
|
17 |
+
|
18 |
+
- name: Set up Python
|
19 |
+
uses: actions/setup-python@v4
|
20 |
+
with:
|
21 |
+
python-version: '3.11'
|
22 |
+
|
23 |
+
- name: Install dependencies
|
24 |
+
run: |
|
25 |
+
python -m pip install --upgrade pip
|
26 |
+
pip install -r requirements.txt
|
27 |
+
|
28 |
+
- name: Run trend graph Script
|
29 |
+
env:
|
30 |
+
RAPID_API_KEY: ${{ secrets.RAPID_API_KEY }}
|
31 |
+
run: |
|
32 |
+
python trend_graph.py
|
33 |
+
- name: List plots folder
|
34 |
+
run: ls -R plots || echo "plots folder not found"
|
35 |
+
- name: Commit and Push Changes
|
36 |
+
run: |
|
37 |
+
git config --global user.name "github-actions[bot]"
|
38 |
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
39 |
+
git add job-postings
|
40 |
+
git commit -m "Add plots generated by scrip"
|
41 |
+
git push
|
42 |
+
env:
|
43 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
44 |
+
|