Update data #199
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: Update data | |
on: | |
workflow_dispatch: {} | |
schedule: | |
# Run Mondays at 2:15 am | |
- cron: "15 2 * * 1" | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# update stats | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- run: pip install -r requirements.txt | |
- run: ./update.sh | |
env: | |
OAUTH_TOKEN: ${{ secrets.GH_API_TOKEN }} | |
GH_USERNAME: ${{ secrets.GH_USERNAME }} | |
- run: | | |
git config user.name 'GitHub Actions' | |
git config user.email '[email protected]' | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "update data: ${timestamp}" || exit 0 | |
git push |