Try GH Actions for set updates #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update sets | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '27 23 * * */3' | ||
jobs: | ||
scheduled: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: damage-calc | ||
- name: Checkout PS | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: smogon/pokemon-showdown | ||
path: pokemon-showdown | ||
- name: Build damage-calc | ||
run: |- | ||
cd damage-calc/import | ||
npm install | ||
npm run compile | ||
cd ../.. | ||
- name: Build PS | ||
run: |- | ||
cd pokemon-showdown | ||
npm install | ||
node build | ||
cd .. | ||
- name: Fetch sets | ||
run: |- | ||
cd pokemon-showdown | ||
node --max-old-space-size=4096 tools/set-import | ||
cd .. | ||
rsync -v --delete -r pokemon-showdown/tools/set-import/sets/ damage-calc/import/node_modules/@smogon/sets | ||
cd damage-calc | ||
node import/ps-import | ||
node import/import | ||
- name: Commit and push if it changed | ||
run: |- | ||
git config user.name "Automated" | ||
git config user.email "[email protected]" | ||
git add -A | ||
git commit -m "Update sets" || exit 0 | ||
git push || exit 0 |