-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (51 loc) · 1.41 KB
/
update-data.yml
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
name: Update site data
on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * *"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install data dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
working-directory: data
- name: Update data
run: python main.py globals,cards,maps
working-directory: data
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
- name: Push data
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git commit -am "Update maps and cards"
git push
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install site dependencies
run: npm ci
working-directory: site
- name: Build site
run: npm run build
working-directory: site
- name: Deploy site
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: site/build
clean: true
force: true