34 lines
967 B
YAML
34 lines
967 B
YAML
name: update gameset_database.json
|
|
|
|
on:
|
|
push:
|
|
schedule:
|
|
- cron: "0 0 1 */1 *"
|
|
|
|
jobs:
|
|
Check_for_update:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v4
|
|
- name: install python3-pip
|
|
run: |
|
|
apt update
|
|
apt install python3-pip -y
|
|
- name: install requirements
|
|
run: |
|
|
pip3 install -r requirements.txt
|
|
- name: update database
|
|
run: |
|
|
python3 update.py
|
|
- name: git commit
|
|
run: |
|
|
git config user.name "${{ secrets.GIT_USERNAME }}"
|
|
git config user.email "${{ secrets.GIT_USEREMAIL }}"
|
|
mtime=$(stat -c "%y" ./gameset_database.json)
|
|
git add .
|
|
export GIT_COMMITTER_DATE=$mtime
|
|
export GIT_AUTHOR_DATE=$mtime
|
|
version=$(date -d "${mtime}" +%Y-%m-%d)
|
|
if [ -n "$(git diff --staged)" ]; then git commit --date "$mtime" -m "update $version" && git push; fi
|