-
-
Notifications
You must be signed in to change notification settings - Fork 14
64 lines (52 loc) · 1.53 KB
/
main.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
60
61
62
63
64
name: Update database
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./database/requirements.txt
- name: Run Script
run: |
python ./database/database_fetcher.py recent
- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Commit and Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add ./database/fetch_recent.log
git add ./database/translations.json
git add ./database/database.db
git commit -m 'Database update'
git push origin HEAD:${{ github.ref }}
- name: Upload Log File
uses: actions/upload-artifact@v4
with:
name: database-fetcher-log
path: ./database/fetch_recent.log
- name: Upload Translation File
uses: actions/upload-artifact@v4
with:
name: game-name-translations
path: ./database/translations.json
- name: Upload Database File
uses: actions/upload-artifact@v4
with:
name: database-file
path: ./database/database.db