Automated Profile Generator #279
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: Automated Profile Generator | |
on: | |
push: | |
schedule: | |
- cron: '0 6 * * 1' # every monday at 6 am | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 #ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@master # checkout the repository content to github runner | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.7.7' # install the python version needed | |
- name: install python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r automated_profile_generator/requirements.txt | |
- name: execute py script | |
run: python automated_profile_generator/run.py | |
- name: commit files | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "update data" -a | |
- name: push changes | |
uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
# source: https://canovasjm.netlify.app/2020/11/29/github-actions-run-a-python-script-on-schedule-and-commit-changes/ |