Skip to content

Update data

Update data #912

Workflow file for this run

name: 'Update data'
on:
schedule:
# Tibia.com kill stats update daily around 03:00–03:15 CE(S)T.
# Schedule the cron job for 04:00 CE(S)T.
# https://www.tibiaqa.com/26439/when-and-how-often-the-kill-statistics-are-updated
- cron: '00 04 * * *'
timezone: 'Europe/Berlin'
# Schedule additional jobs in case something went wrong.
- cron: '30 04 * * *'
timezone: 'Europe/Berlin'
- cron: '00 05 * * *'
timezone: 'Europe/Berlin'
workflow_dispatch:
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm install
- name: Update data
run: |
npm run build
git config user.name 'Tibia kill stats bot'
git config user.email 'killstats@tibiamaps.io'
date=$(date +'%Y-%m-%d')
git add data
git commit data -m "Add data for date=${date}" || true
git push