-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
302e3f6
commit 4cff8a9
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Run Data Python script | ||
|
||
on: | ||
schedule: | ||
- cron: '30 6 * * *' # 11:30 AM IST (06:00 AM UTC) | ||
- cron: '0 9 * * *' # 03:00 PM IST (09:00 AM UTC) | ||
- cron: '0 13 * * *' # 07:00 PM IST (01:00 PM UTC) | ||
- cron: '0 16 * * *' # 10:00 PM IST (04:00 PM UTC) | ||
workflow_dispatch: # Allow manual triggering of the workflow | ||
|
||
jobs: | ||
run_script: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install requests beautifulsoup4 | ||
- name: Run Python script | ||
env: | ||
SIURL: ${{ secrets.KARM_URL }} | ||
run: python data.py | ||
|
||
- name: Commit changes | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "GitHub Actions" | ||
git add data/data1.json || git commit -m "Create data1.json" | ||
git commit -m "Update data1.json" || echo "No changes to commit" | ||
git pull origin main || echo "No remote changes to pull" | ||
git push origin main | ||
- name: Push changes | ||
uses: ad-m/github-push-action@v0.6.0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: main |