README build #26
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: README build | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 4 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Get Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Configure pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('cache/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: python -m pip install -r cache/requirements.txt | |
- name: Update README file | |
env: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
USER_NAME: ${{ secrets.USER_NAME }} | |
run: python today.py | |
- name: Commit | |
run: |- | |
git add . | |
git diff | |
git config --global user.email "[email protected]" | |
git config --global user.name "lorenzobandini/GitHub-Actions-Bot" | |
git commit -m "Updated README" -a || echo "No changes to commit" | |
git push |