m-action #4076
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: m-action | |
on: | |
schedule: | |
- cron: '*/5 * * * 2-5' # runs every 5 miniutes only on selected days of the week change this to your liking dont unnecesarily run actions all days of the week as it will increase costs | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout repo content | |
uses: actions/[email protected] # checkout the repository content to github runner | |
- name: setup python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.8.0' # install the python version needed | |
- name: install python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: execute py script # run sj-gobierno.py to get the latest data | |
env: | |
EMAIL_ADDRESS: ${{ secrets.EMAIL_ADDRESS }} | |
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }} | |
EMAIL_RECIPIENT: ${{ secrets.EMAIL_RECIPIENT }} | |
run: python fetcher.py | |
- name: commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "update data" -a | |
- name: push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |