Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
Update Data Via Github Action
  • Loading branch information
IsaacMilarky authored Nov 1, 2023
1 parent 0f5fd7f commit acd0431
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update data

on:
workflow_dispatch: {}
schedule:
# Run Mondays at 2:15 am
- cron: "15 2 * * 0"

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# update stats
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: cache pip
uses: actions/cache@v3
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

0 comments on commit acd0431

Please sign in to comment.