Skip to content

Update data

Update data #1759

Workflow file for this run

name: 'Update data'
on:
schedule:
# Tibia.com kill stats update daily around 04:00 CE(S)T.
# Schedule the cron job for 04:30 CE(S)T, i.e. 02:30 UTC.
# https://www.tibiaqa.com/26439/when-and-how-often-the-kill-statistics-are-updated?show=26440#a26440
- cron: '30 02 * * *'
# Schedule additional jobs in case something went wrong.
- cron: '30 03 * * *'
- cron: '30 04 * * *'
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