-
-
Notifications
You must be signed in to change notification settings - Fork 20
63 lines (54 loc) · 1.81 KB
/
Copy pathupdate-creatures.yml
File metadata and controls
63 lines (54 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Monthly creatures data update
on:
schedule:
# 04:17 UTC on the 1st of every month (odd minute to avoid the top-of-hour cron rush)
- cron: '17 4 1 * *'
workflow_dispatch:
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout development
uses: actions/checkout@v4
with:
ref: development
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Fetch creatures from AoN
run: node tools/aon-downloader/fetch-creatures.js --force
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Commit data to development
run: |
git add public/creatures.json public/metadata.json
if git diff --cached --quiet; then
echo "No data changes this month."
else
git commit -m "chore: monthly AoN creatures data refresh"
git push origin development
fi
- name: Commit data to main
run: |
git checkout main
git checkout development -- public/creatures.json public/metadata.json
git add public/creatures.json public/metadata.json
if git diff --cached --quiet; then
echo "main already up to date."
else
git commit -m "chore: monthly AoN creatures data refresh"
git push origin main
fi
# Pushes made with GITHUB_TOKEN don't trigger the push-based deploy workflow,
# so call it explicitly to rebuild the Pages branch with the fresh data.
deploy:
needs: update
uses: ./.github/workflows/deploy.yml
permissions:
contents: write