-
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
Piet Brömmel
committed
May 9, 2024
1 parent
0c9b3f6
commit 8cd1b1c
Showing
2 changed files
with
23 additions
and
8 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 |
---|---|---|
@@ -1,26 +1,40 @@ | ||
name: Run Python Script | ||
name: update data | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
# TODO: should run at 0:00 6:00 12:00 and 16:00 o'clock every day. | ||
- cron: '0 8 * * 1' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-python: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
python-version: '3.10' | ||
|
||
- name: Install Dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Run Python Script | ||
- name: Fetch Data | ||
env: | ||
API_KEY: ${{ secrets.API_KEY }} | ||
run: python your_script.py | ||
CLIENT_ID: ${{ secrets.CLIENT_ID }} | ||
run: python fetch_data.py | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
add-paths: | | ||
data/* | ||
commit-message: data update | ||
committer: GitHub <[email protected]> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
delete-branch: true | ||
title: 'Update Deutsche Bahn data' | ||
body: 'Update Deutsche Bahn data' |
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 @@ | ||
requests |