-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (50 loc) · 1.68 KB
/
Copy pathsats-json.yml
File metadata and controls
51 lines (50 loc) · 1.68 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
name: Update SATS-JSON game data
on:
workflow_dispatch:
schedule:
- cron: '37 5 * * *'
jobs:
sats-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout game data repo
uses: actions/checkout@v4
with:
repository: BitCraftToolBox/BitCraft_GameData
ref: sats-json
path: workspace/data/sats-json
token: ${{ secrets.ACTIONS_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
- name: Install dependencies
run: pip install -r scripts/sats-json/requirements.txt
- name: Remove old data
run: rm -rf workspace/data/sats-json/*
shell: bash
- name: Run data script
id: update-data
env:
BITCRAFT_SPACETIME_HOST: ${{ secrets.BITCRAFT_SPACETIME_HOST }}
BITCRAFT_GLOBAL_MODULE: ${{ secrets.BITCRAFT_GLOBAL_MODULE }}
BITCRAFT_REGION_MODULE: ${{ secrets.BITCRAFT_REGION_MODULE }}
BITCRAFT_BEARER_TOKEN: ${{ secrets.BITCRAFT_BEARER_TOKEN }}
DATA_DIR: ./workspace/data/sats-json
run: python scripts/sats-json/gamedata_sats_json.py
- name: Commit changes
if: steps.update-data.outputs.updated_data == 'true'
run: |
cd workspace/data/sats-json
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
if ! git diff --cached --quiet; then
git commit -m "Update game data: $(date +%Y-%m-%d)"
git push origin sats-json
fi
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}