Skip to content

Instantly share code, notes, and snippets.

@wzieba
Created August 9, 2020 10:28
Show Gist options
  • Save wzieba/eba4b500932ddc1d0eff68f31d451ba5 to your computer and use it in GitHub Desktop.
Save wzieba/eba4b500932ddc1d0eff68f31d451ba5 to your computer and use it in GitHub Desktop.
name: Build README
on:
push:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python -m pip install -r requirements.txt
- name: Run tests
run: |
python -m unittest -v test_main
- name: Update README
run: |-
python main.py
cat README.md
- name: Commit and push if changed
run: |-
git diff
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Update README.md"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment