-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (64 loc) · 2.23 KB
/
update_data.yml
File metadata and controls
75 lines (64 loc) · 2.23 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
64
65
66
67
68
69
70
71
72
73
74
75
name: Update Data
on:
workflow_dispatch:
repository_dispatch:
types: [run_update_data]
jobs:
run_script:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
- name: Fetch all branches
run: git fetch origin
- name: Reset update-data branch with main
run: |
BRANCH_NAME="update-data"
git checkout $BRANCH_NAME
git reset --hard origin/main
- name: Push new branch to the remote
run: |
# Push the reset branch, forcefully overwriting remote update-data
git push --force --set-upstream origin update-data
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r workflow_scripts/requirements.txt
export TF_USE_LEGACY_KERAS=True
# Run scripts
- name: "Run script: Get buffs/debuffs"
run: |
python workflow_scripts/get_buffs_debuffs.py
- name: "Run script: Get character ids"
run: |
python workflow_scripts/get_character_ids.py
- name: "Run script: Get hero descriptions"
run: |
python workflow_scripts/get_hero_description.py
- name: "Run script: Get hero official stats"
run: |
python workflow_scripts/get_hero_official_stats.py
- name: "Run script: Calculate hero stats"
run: |
python workflow_scripts/get_hero_stats.py
- name: "Run script: Get hero types"
run: |
python workflow_scripts/get_hero_types.py
- name: Commit and push changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
DATE=$(date +"%Y-%m-%d")
git add .
git commit -m "Update Data by GitHub Actions on $DATE"
git push
env:
GITHUB_TOKEN: ${{ secrets.UPDATE_SECRET }}