Skip to content

Automatic Data Update #1512

Automatic Data Update

Automatic Data Update #1512

Workflow file for this run

name: Automatic Data Update
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
DataUpdater:
name: Automatic Data Update
runs-on: ubuntu-latest
services:
flaresolverr:
image: ghcr.io/flaresolverr/flaresolverr:latest
env:
LOG_LEVEL: info
LOG_HTML: false
CAPTCHA_SOLVER: none
TZ: Europe/London
ports:
- 8191:8191
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
registry-url: https://registry.yarnpkg.com/
- name: Install Dependencies
run: yarn --immutable
- name: Run Smogon Tiers updater
run: yarn au:tiers
- name: Run Learnsets updater
run: yarn au:learnsets
- name: Run Abilities Updater
run: yarn au:abilities
- name: Run Items Updater
run: yarn au:items
- name: Run Moves Updater
run: yarn au:moves
- name: Run Cries Updater
run: yarn au:cries
- name: Wait for Flaresolverr to be online
working-directory: ./scripts
run: ./wait-for-port.sh
env:
PORT: 8191
- name: Run Classifications Updater
run: yarn au:classifications || true
- name: Run IPA Updater
run: yarn au:ipa || true
- name: Run Flavor Text Updater
run: yarn au:flavors || true
- name: Build code
run: yarn build
- name: Start server in the background
working-directory: ./scripts
run: |
yarn start &
./wait-for-port.sh
- name: Update test data
run: yarn au:testdata
- name: Run prettier on the code
run: yarn format
- name: Commit any changes and create a pull request
env:
GITHUB_USER: github-actions[bot]
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add .;
if ! git diff-index --quiet HEAD --; then
git remote set-url origin "https://${GITHUB_TOKEN}:x-oauth-basic@github.com/${GITHUB_REPOSITORY}.git";
git config --local user.email "${GITHUB_EMAIL}";
git config --local user.name "${GITHUB_USER}";
git commit -sam "refactor: update data [skip publish]";
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
fi
- name: Create artifact of flavor text update log file
uses: actions/upload-artifact@v4
with:
name: formats_log_file
path: scripts/data-gen-scripts/scripted-updaters/flavor-text-updater/output.log
if-no-files-found: error
- name: Create artifact of classifications update log file
uses: actions/upload-artifact@v4
with:
name: classification_log_file
path: scripts/data-gen-scripts/scripted-updaters/classification-updater/output.log
if-no-files-found: error