Created
June 30, 2022 08:30
-
-
Save mrlnc/1ebaaeac5d7b3951f6a7bfa2a0abc468 to your computer and use it in GitHub Desktop.
Github Action: run python script & commit results
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
name: fetch website and commit results | |
on: | |
schedule: | |
- cron: "30 * * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: set timezone | |
uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Europe/Berlin" | |
# checkout repo to actions runner | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: execute py script | |
run: | | |
python fetch_bs.py | |
- name: setup git config | |
run: | | |
# setup git | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
- name: commit | |
run: | | |
# Stage the file, commit and push | |
git add results.csv | |
git commit -m "update results" | |
git push origin main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment